Message205027
To create a new event loop, use set_event_loop(new_event_loop()). You have to do that if you want an event loop in a thread; it's also handy in unit tests. (However asyncio's own unit tests only call new_event_loop() and pass it around explicitly with loop=...; they set the default event loop to None with set_event_loop(None).)
Creating a second event loop (in the same thread) while you already have an event loop is fraught with problems -- while the second one is running any events associated with the first one won't fire.
(This API is not random -- it is intentionally restricted to allow certain platform event loops to be adapted.) |
|
Date |
User |
Action |
Args |
2013-12-02 16:47:41 | gvanrossum | set | recipients:
+ gvanrossum, pitrou, vstinner, larry |
2013-12-02 16:47:41 | gvanrossum | set | messageid: <1386002861.17.0.382479151286.issue19860@psf.upfronthosting.co.za> |
2013-12-02 16:47:41 | gvanrossum | link | issue19860 messages |
2013-12-02 16:47:41 | gvanrossum | create | |
|