summaryrefslogtreecommitdiff
path: root/Doc/library/asyncio-eventloop.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/asyncio-eventloop.rst')
-rw-r--r--Doc/library/asyncio-eventloop.rst23
1 files changed, 21 insertions, 2 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index d7201601c5..fa6a29604c 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -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
@@ -110,8 +128,9 @@ keywords to your callback, use :func:`functools.partial`. For example,
called after :meth:`call_soon` returns, when control returns to the event
loop.
- This operates as a FIFO queue, callbacks are called in the order in
- which they are registered. Each callback will be called exactly once.
+ This operates as a :abbr:`FIFO (first-in, first-out)` queue, callbacks
+ are called in the order in which they are registered. Each callback
+ will be called exactly once.
Any positional arguments after the callback will be passed to the
callback when it is called.