pep 525: Fix formatting
This commit is contained in:
parent
be5a9b53d3
commit
8f8cdb00ed
26
pep-0525.txt
26
pep-0525.txt
|
@ -260,20 +260,22 @@ with ``firstiter`` and ``finalizer`` fields.
|
||||||
asyncio
|
asyncio
|
||||||
-------
|
-------
|
||||||
|
|
||||||
The asyncio event loop will use ``sys.set_asyncgen_hooks()`` API to maintain
|
The asyncio event loop will use ``sys.set_asyncgen_hooks()`` API to
|
||||||
a weak set of all scheduled asynchronous generators, and to schedule their
|
maintain a weak set of all scheduled asynchronous generators, and to
|
||||||
``aclose()`` coroutine methods when it is time for generators to be GCed.
|
schedule their ``aclose()`` coroutine methods when it is time for
|
||||||
|
generators to be GCed.
|
||||||
|
|
||||||
To make sure that asyncio programs can finalize all scheduled asynchronous
|
To make sure that asyncio programs can finalize all scheduled
|
||||||
generators reliably, we propose to add a new event loop method
|
asynchronous generators reliably, we propose to add a new event loop
|
||||||
``loop.shutdown_asyncgens(*, timeout=30)``. The method will schedule all
|
method ``loop.shutdown_asyncgens(*, timeout=30)``. The method will
|
||||||
currently open asynchronous generators to close with an ``aclose()`` call.
|
schedule all currently open asynchronous generators to close with an
|
||||||
|
``aclose()`` call.
|
||||||
|
|
||||||
After calling the ``loop.shutdown_asyncgens()`` method, the event loop will
|
After calling the ``loop.shutdown_asyncgens()`` method, the event loop
|
||||||
issue a warning whenever a new asynchronous generator is iterated for the first
|
will issue a warning whenever a new asynchronous generator is iterated
|
||||||
time. The idea is that after requesting all asynchronous generators to be
|
for the first time. The idea is that after requesting all asynchronous
|
||||||
shutdown, the program should not execute code that iterates over new
|
generators to be shutdown, the program should not execute code that
|
||||||
asynchronous generators.
|
iterates over new asynchronous generators.
|
||||||
|
|
||||||
An example of how ``shutdown_asyncgens`` should be used::
|
An example of how ``shutdown_asyncgens`` should be used::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue