[Async-sig] Inadvertent layering of synchronous code as frameworks adopt asyncio
Glyph
glyph at twistedmatrix.com
Mon Mar 25 20:37:51 EDT 2019
> There's another form of nested event loop invocation where two separate event loop objects exist. That is a much more worrisome scenario, because callbacks associated with one event loop won't run at all while one is waiting for a task on the other loop.
This strikes me as a much *less* worrisome scenario. It’s probably a bad idea in application code (just ... await the thing you want to run_until_complete?) but it allows things like debuggers and performance telemetry reporters to use asyncio internally while presenting a necessarily synchronous interface to the caller.
So this might be a huge performance problem if you do it accidentally, but it’ll also be relatively easy to spot, and crucially it doesn’t violate any explicit guarantees of the underlying API.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/async-sig/attachments/20190325/ca1e8117/attachment.html>
More information about the Async-sig
mailing list