summaryrefslogtreecommitdiffstats
path: root/Doc/library/asyncio-task.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/asyncio-task.rst')
-rw-r--r--Doc/library/asyncio-task.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 7e09b16..d3cfd5f 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -165,7 +165,7 @@ Sleeping
If *result* is provided, it is returned to the caller
when the coroutine completes.
- .. _asyncio-date-coroutine:
+ .. _asyncio_example_sleep:
Example of coroutine displaying the current date every second
during 5 seconds::
@@ -219,6 +219,8 @@ Running Tasks Concurrently
If the *gather* itself is cancelled, the cancellation is
propagated regardless of *return_exceptions*.
+ .. _asyncio_example_gather:
+
Example::
import asyncio
@@ -316,6 +318,8 @@ Timeouts
If the wait is cancelled, the future *fut* is also cancelled.
+ .. _asyncio_example_waitfor:
+
Example::
async def eternity():
@@ -539,6 +543,8 @@ Task Object
suppressing cancellation completely is not common and is actively
discouraged.
+ .. _asyncio_example_task_cancel:
+
The following example illustrates how coroutines can intercept
the cancellation request::