[New-bugs-announce] [issue42838] Wait for cleanup coroutines before event loop is closed.

xloem report at bugs.python.org
Wed Jan 6 08:56:08 EST 2021


New submission from xloem <0xloem at gmail.com>:

To handle destruction of resources especially during exceptions, it would be nice if there were some way to provide coroutines/tasks that run at the termination or closure of an event loop.  There are a lot of api options here.  Maybe a simple one would be to have close() call a run_until_closed() function that starts all of these and steps the loop to wait for them, before closing, and provide run_close() functions to queue them for delay.

----------
components: asyncio
messages: 384503
nosy: asvetlov, xloem, yselivanov
priority: normal
severity: normal
status: open
title: Wait for cleanup coroutines before event loop is closed.
type: enhancement
versions: Python 3.10, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42838>
_______________________________________


More information about the New-bugs-announce mailing list