mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #24487: Rename async() -> ensure_future() in asyncio docs.
Patch by Martin Panter.
This commit is contained in:
parent
59a3b6764c
commit
04356e1f6f
4 changed files with 13 additions and 13 deletions
|
@ -448,9 +448,9 @@ buffer size reaches the low-water mark.
|
|||
Coroutines and protocols
|
||||
------------------------
|
||||
|
||||
Coroutines can be scheduled in a protocol method using :func:`async`, but there
|
||||
is no guarantee made about the execution order. Protocols are not aware of
|
||||
coroutines created in protocol methods and so will not wait for them.
|
||||
Coroutines can be scheduled in a protocol method using :func:`ensure_future`,
|
||||
but there is no guarantee made about the execution order. Protocols are not
|
||||
aware of coroutines created in protocol methods and so will not wait for them.
|
||||
|
||||
To have a reliable execution order, use :ref:`stream objects <asyncio-streams>` in a
|
||||
coroutine with ``yield from``. For example, the :meth:`StreamWriter.drain`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue