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 gvanrossum
Recipients gvanrossum, larry, pitrou, vstinner
Date 2013-12-02.16:47:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386002861.17.0.382479151286.issue19860@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2013-12-02 16:47:41gvanrossumsetrecipients: + gvanrossum, pitrou, vstinner, larry
2013-12-02 16:47:41gvanrossumsetmessageid: <1386002861.17.0.382479151286.issue19860@psf.upfronthosting.co.za>
2013-12-02 16:47:41gvanrossumlinkissue19860 messages
2013-12-02 16:47:41gvanrossumcreate