Andrew Svetlov <[email protected]> added the comment:
Sorry, no.
The feature was requested many times but was constantly rejected.
By this, you are adding a BLOCKING call to your async function.
At least it leads to log warning about too long callback execution.
Moreover, I suspect that `run_until_complete` reentrancy requirement breaks the
existing third-party loop implementations, not all loops can be fixed easily.
The last: calling blocking code from async code is the anti-pattern, asyncio
explicitly discourages it.
You should convert all your stack to async functions and add sync stubs
when needed like
def sync_call(arg):
asyncio.get_event_loop().run_until_complete(async_call(arg))
Yuri, do you agree with me?
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33523>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com