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
RuntimeError: no running event loop
after upgrading to 0.5.0
#250
Comments
RuntimeError: no running event loop
after upgrading to 0.5.0
In Python 3.8 and upwards, passing loop arguments to manay asyncio objects (including
This means that instantiation of these objects outside the event loop (i.e., there is no running event loop in the current thread && the current line of code is not ultimately executed from a coroutine bound to a specific event loop) is now prohibited. So, the new, intended way of use is to create janus/asyncio queues in a coroutine and lazily refer them in the synchronous counterparts. |
Note that, The new API, |
Are there any proofs that |
All that is stated now is |
I understand the reasoning behind the changes, but the consequences are not that obvious at all. |
The reason is: Queue does not exist without the loop. |
Unfortunately, changes in #246 broke the code that relies on creating an instance of
janus.Queue
outside of the scope of a running event loop, for no obvious reason.Also, the behavior now contradicts with the behavior of
asyncio.Queue
.Is there any good reason to not just use
asyncio.get_event_loop
? From performance perspective it shouldn't be significant.The text was updated successfully, but these errors were encountered: