-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Consider using asyncioreactor #8642
Comments
FWIW I tried using the asyncioreactor the other day and it mostly seemed to work, modulo a couple of test failures. The big difference seems to be that |
That got fixed recently: twisted/twisted#1237. @ShadowJonathan we're familiar with asyncioreactor (we use it in sygnal). Feel free to try it out on Synapse and let us know how it goes. |
@richvdh it looks like it's being planned for Said referenced releases also aren't available in pypi yet: https://pypi.org/project/Twisted/#history, so for testing, i'm going to use |
I've ran some experiments with |
we've considered it, so I think this issue can be closed. |
Agreed, originally I wanted to use this to segway into more asyncio, but tbh I don't see that happening;
|
given that twisted has now had a couple of releases since twisted/twisted#1237 landed, it might be good to consider this again. Even though you can't seamlessly mix twisted and asyncio stuff, it does open a route towards iteratatively moving away from twisted-specific stuff (and exploring whether |
Idea
Use
twisted.internet.asyncioreactor
for synapse's twisted reactor.Description
This is part of my idea that synapse should consider moving forward, beyond, or at least next to twisted, to also use
asyncio
's economy of libraries and functions. With theasyncioreactor
, it's possible to mixtwisted
andasyncio
functionality with eachother.It's also possible to use
uvloop
in addition to this, allowing a big IO performance boost.Some links:
asyncioreactor
: https://twistedmatrix.com/documents/current/api/twisted.internet.asyncioreactor.htmlasyncio
/twisted
intermixing: https://gist.github.com/ldjebran/4febf298232a6fd86871df25d4dc00ddDeferred.asFuture()
: https://twistedmatrix.com/documents/current/api/twisted.internet.defer.Deferred.html#asFutureTwisted and Asyncio (blog post): https://meejah.ca/blog/python3-twisted-and-asyncio
Considerations
I have two concerns with doing this:
Will the existing twisted-based code be stable on a new reactor based out of
asyncio
?Will the reactor impact performance (negatively)?
For 1, I want to run a server along my existing one, only joining some channels, and watch out for any crashes and the like, and/or perform test benches with
asyncioreactor
selected.For 2, I'd want to know what the best way is for me to collect such statistics and/or how to compare them with a normal server.
The text was updated successfully, but these errors were encountered: