mirror of https://github.com/python/cpython
asyncio doc: explain where does the task come from.
This commit is contained in:
parent
68bccb4922
commit
86e139ad65
|
@ -108,10 +108,12 @@ Sequence diagram of the example:
|
|||
.. image:: tulip_coro.png
|
||||
:align: center
|
||||
|
||||
The diagram shows the logical links between the task and the two coroutines, it
|
||||
does not describe exactly how things work internally. For example, the sleep
|
||||
coroutine creates an internal future which uses
|
||||
:meth:`BaseEventLoop.call_later` to wake up the task in 1 second.
|
||||
The "Task" is created by the :meth:`BaseEventLoop.run_until_complete` method
|
||||
when it gets a coroutine instead of a task.
|
||||
|
||||
The diagram shows the control flow, it does not describe exactly how things
|
||||
work internally. For example, the sleep coroutine creates an internal future
|
||||
which uses :meth:`BaseEventLoop.call_later` to wake up the task in 1 second.
|
||||
|
||||
|
||||
InvalidStateError
|
||||
|
|
Loading…
Reference in New Issue