You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.7 introduces new asyncio.run function. Would be nice to backport its implementation for standalone loop in AsyncToSync. It adds an extra level of reliability by wrapping loop.run_until_complete with try/finally, cancelling pending tasks and closing async generators.
On a side note, it seems that loop.create_task should be preferred to asyncio.ensure_future in most cases, according to Guido.
The text was updated successfully, but these errors were encountered:
When Python 3.7 is released I'll come back and consider it, but we're still months away and we'd have to keep the existing implementation anyway to support 3.5. I will, however, go and crib from the implementation to make sure AsyncToSync is doing all the right cleanup.
As for create_task, I've moved to that here: c7e0065
Python 3.7 introduces new
asyncio.run
function. Would be nice to backport its implementation for standalone loop in AsyncToSync. It adds an extra level of reliability by wrappingloop.run_until_complete
withtry/finally
, cancelling pending tasks and closing async generators.On a side note, it seems that
loop.create_task
should be preferred toasyncio.ensure_future
in most cases, according to Guido.The text was updated successfully, but these errors were encountered: