-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
accept loop= kwarg #97
Comments
The tough ones are We discussed a few options on IRC, and concluded:
So we will try by introducing an "instantiate an API object"-type method (final naming TBD) that has all the f0 = txaio.as_future(...)
f1 = txaio.call_later(...) becomes: api = txaio.create_api(loop=asyncio.new_event_loop())
f0 = api.as_future(...)
f1 = api.call_later(...) This won't change any existing code, but code that wants to use many custom loops can opt-in by using the |
Worth noting: you can already use an explicit event-loop (or reactor), but only one. This feature is for users of asyncio to use multiple event loops at once. Twisted doesn't (yet) support this. |
See #98 (comment) |
See crossbario/autobahn-python#747 for context.
asyncio allows passing in a
loop=
kwarg to theFuture
constructor. Currently, we always pass the One True Loop (whateverconfig.loop
says).txaio.create_future
APIs should accept an (optional)loop=
kwarg (orreactor=
orloop_or_reactor=
?). It's an error on Twisted if this is not the same object asconfig.loop
. For asyncio, we pass it along toFuture
.The affected APIs are:
The text was updated successfully, but these errors were encountered: