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:29:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462566592.56.0.446416543988.issue26969@psf.upfronthosting.co.za>
In-reply-to
Content
> Honestly I think it's pretty crazy and out there to have multiple event
loops in the same thread. That feels like an anti-pattern inspired by some
other event loop APIs (in other languages) that encourage this. But asyncio
was not designed for that.

I agree.

OTOH, if you're designing a library for asyncio, you want it to be as foolproof as possible, so many people simply pass an event loop everywhere.  It's especially annoying when you have a huge chunk of code that didn't need the loop, and then when something needs it you have to refactor everything or use "get_event_loop".

In terms of performance, I don't think this is gonna affect anything, it's just a couple of additional thread-local sets in the Loop.run method.

And we can design "get_running_loop" to raise a clear exception if no loop is currently running.
History
Date User Action Args
2016-05-06 20:29:52yselivanovsetrecipients: + yselivanov, gvanrossum, vstinner, r.david.murray, Ilya.Kulakov
2016-05-06 20:29:52yselivanovsetmessageid: <1462566592.56.0.446416543988.issue26969@psf.upfronthosting.co.za>
2016-05-06 20:29:52yselivanovlinkissue26969 messages
2016-05-06 20:29:52yselivanovcreate