4 ms·
Yes - and it was great fun! There was a post on HN that was asking about real-world examples of asyncio code that wasn't `asncio.sleep()`. I think my project i
by gwillz 8y ago
Yes - and it was great fun!
There was a post on HN that was asking about real-world examples of asyncio code that wasn't `asncio.sleep()`. I think my project is pretty good example for that - and a strange example too because it involved a lot of hardware interfaces.
I've been meaning to open-source the project ever since we axed it. I was the only real programmer on the job, so I'm itching for feedback on it. So if anyone's interested I'll post it here.
I had actually written it 3 times over. First as raw socket server, then in twisted, then on top of asyncio.
So yes, asyncio is a bit of a mess. It's documentation is a bit odd and I have several gripes. What helped we was realising that there was an 'async way' and an 'callback way' to everything in asyncio. So not mixing the two together and ignoring the callback parts really _really_ helped.
I don't know if this is true, but I recall reading somewhere that asyncio was not designed with coroutines initially and this explains the dual-personality of the library. I can't find any evidence that asyncio existed before 3.3, so I can't back that up.
- personalcompute 8y agoI would be interested in seeing and reviewing your asyncio work gwillz! I have a small (750 sloc) network service implemented with asyncio and ran into some design problems around modularly handling healthchecking, exception handling/monitoring, and auto recovery/restart. I was unable to find much in the way of large software written with asyncio to learn better patterns from, so ended up with what, to me, feel like mediocre solutions. My email is in my profile.