mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
parent
76febd0792
commit
03660041d2
9 changed files with 298 additions and 4 deletions
|
@ -88,6 +88,24 @@ Run an event loop
|
|||
This is idempotent and irreversible. No other methods should be called after
|
||||
this one.
|
||||
|
||||
|
||||
.. coroutinemethod:: AbstractEventLoop.shutdown_asyncgens()
|
||||
|
||||
Schedule all currently open :term:`asynchronous generator` objects to
|
||||
close with an :meth:`~agen.aclose()` call. After calling this method,
|
||||
the event loop will issue a warning whenever a new asynchronous generator
|
||||
is iterated. Should be used to finalize all scheduled asynchronous
|
||||
generators reliably. Example::
|
||||
|
||||
try:
|
||||
loop.run_forever()
|
||||
finally:
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
loop.close()
|
||||
|
||||
.. versionadded:: 3.6
|
||||
|
||||
|
||||
.. _asyncio-pass-keywords:
|
||||
|
||||
Calls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue