New submission from xloem <0xl...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue42838>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to