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 yselivanov
Recipients Ilya.Kulakov, gvanrossum, r.david.murray, vstinner, yselivanov
Date 2016-05-06.20:18:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462565890.45.0.731828882448.issue26969@psf.upfronthosting.co.za>
In-reply-to
Content
> Thread may have multiple event loops, but only one, explicitly associated, is default. And it's not necessary one which is currently running.

Ah, I got it.  You know what, this actually is starting to make sense.

Guido, what do you think about this?  Essentially, (Ilya, feel free to correct me if I'm wrong), we can implement the following:

1. Add a new thread-local storage, say "_running_loop"

2. Add another method "asyncio.get_running_loop()"

3. Update some places in asyncio where we currently use "get_event_loop()", such as Future constructor, Task.current_task, etc.

This might actually solve an awkwardness of get_event_loop(), which when called, instantiates an event loop if it doesn't find one, which makes it difficult to know if an event loop was running before the call.
History
Date User Action Args
2016-05-06 20:18:10yselivanovsetrecipients: + yselivanov, gvanrossum, vstinner, r.david.murray, Ilya.Kulakov
2016-05-06 20:18:10yselivanovsetmessageid: <1462565890.45.0.731828882448.issue26969@psf.upfronthosting.co.za>
2016-05-06 20:18:10yselivanovlinkissue26969 messages
2016-05-06 20:18:10yselivanovcreate