[New-bugs-announce] [issue42838] Wait for cleanup coroutines before event loop is closed.
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.
nosy: asvetlov, xloem, yselivanov
title: Wait for cleanup coroutines before event loop is closed.
versions: Python 3.10, Python 3.8
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce