Bug #24573
Change middlewared to use asyncio
Description
=====
Hello,
For those unaware, I have been working on porting our middleware
(middlewared) to use python asyncio [1].
This branch [2] is in the final stage of development (I am fixing a
few minor issues) and I was planning on merging that to master on
Friday.
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
modules).
That allow us to take more advantage of process/thread pool without
having to worry with system modules being patched and block the event
loop.
That being said, I would like to urge anyone working on middlewared or
python-savvy to take a look at the diff [2] and tell me if you have
any concerns.
[1] https://docs.python.org/3/library/asyncio.html
[2] https://github.com/freenas/freenas/compare/feature/asyncio
Thanks! ====
Related issues
History
#1
Updated by William Grzybowski almost 4 years ago
- Status changed from Fix In Progress to Resolved
feature/asyncio branch has been merged
#2
Updated by William Grzybowski almost 4 years ago
- Status changed from Resolved to Ready For Release
#3
Updated by Dru Lavigne over 3 years ago
- Target version changed from 11.1 to 11.1-BETA1
#4
Updated by William Grzybowski over 3 years ago
- Related to Bug #26204: Traceback error related to scheduled scrubs added
#5
Updated by Dru Lavigne over 3 years ago
- Status changed from Ready For Release to Resolved
#6
Updated by William Grzybowski over 3 years ago
- Needs QA changed from Yes to No