This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lschoe
Recipients asvetlov, lschoe, yselivanov
Date 2019-10-28.18:54:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572288883.03.0.566974288324.issue38599@roundup.psfhosted.org>
In-reply-to
Content
The current implementation of asyncio.run() is focused quite a bit on one-shot use. After the call returns, the default event loop is even gone: calling asyncio.get_event_loop() gives "RuntimeError: There is no current event loop in thread 'MainThread'."

It would be nice if asyncio.run() uses the default loop if it's available (and not running), and that the default loop remains intact after the call returns. 

This way multiple calls to asyncio.run() that all use the default loop are supported, maybe using an asyncio.Queue (or whatever) across these calls---attaching everything to the same (default) loop.

I find this very useful, for instance when writing unit tests.
History
Date User Action Args
2019-10-28 18:54:43lschoesetrecipients: + lschoe, asvetlov, yselivanov
2019-10-28 18:54:43lschoesetmessageid: <1572288883.03.0.566974288324.issue38599@roundup.psfhosted.org>
2019-10-28 18:54:43lschoelinkissue38599 messages
2019-10-28 18:54:42lschoecreate