Change middlewared to use asyncio
For those unaware, I have been working on porting our middleware
(middlewared) to use python asyncio .
This branch  is in the final stage of development (I am fixing a
few minor issues) and I was planning on merging that to master on
In my opinion asyncio is a much more powerful "tool" to write
single-threaded concurrent code than gevent (what we currently use).
One can't really compare asyncio and gevent on a 1:1 basis because
gevent is built on top of greenlet (another event loop implementation,
so it would make more sense to compare asyncio to that). Both provide
co-routines in python, however asyncio does things explicitly as
opposed to implicitly on gevent (by monkey patching python system
That allow us to take more advantage of process/thread pool without
having to worry with system modules being patched and block the event
That being said, I would like to urge anyone working on middlewared or
python-savvy to take a look at the diff  and tell me if you have