mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
bpo-33649: Note that asyncio.run() calls shutdown_asyncgens() (GH-9380)
This commit is contained in:
parent
dbdee0073c
commit
ac94e38d07
1 changed files with 5 additions and 1 deletions
|
@ -152,8 +152,12 @@ Running and stopping the loop
|
||||||
close with an :meth:`~agen.aclose()` call. After calling this method,
|
close with an :meth:`~agen.aclose()` call. After calling this method,
|
||||||
the event loop will issue a warning if a new asynchronous generator
|
the event loop will issue a warning if a new asynchronous generator
|
||||||
is iterated. This should be used to reliably finalize all scheduled
|
is iterated. This should be used to reliably finalize all scheduled
|
||||||
asynchronous generators, e.g.::
|
asynchronous generators.
|
||||||
|
|
||||||
|
Note that there is no need to call this function when
|
||||||
|
:func:`asyncio.run` is used.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
try:
|
try:
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue