Issue #24487: Rename async() -> ensure_future() in asyncio docs.

Patch by Martin Panter.
This commit is contained in:
Yury Selivanov 2015-06-30 22:13:22 -04:00
parent 59a3b6764c
commit 04356e1f6f
4 changed files with 13 additions and 13 deletions

View file

@ -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`