[Async-sig] Asynchronous cleanup is a problem
Glyph Lefkowitz
glyph at twistedmatrix.com
Wed Jul 6 20:47:10 EDT 2016
> On Jul 6, 2016, at 5:25 PM, Yury Selivanov <yselivanov at gmail.com> wrote:
>
> The problem is that the GC can’t execute async code, and we don’t have any control over GC. What if we add a mechanism to control how async generators (AG) are destructed. Let’s say we add new function to the sys module - `sys.set_async_generator_finalizer(finalizer)`. We already have sys.set_coroutine_wrapper(), so this isn’t something unprecedented.
There isn't just one event loop though, and what trampoline to attach a dying coroutine to depends heavily on what event loop it came from. It seems like a single global value for this in 'sys' would just be ... wrong.
-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/async-sig/attachments/20160706/0e025e90/attachment-0001.html>
More information about the Async-sig
mailing list