We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 452042d commit f077241Copy full SHA for f077241
1 file changed
Doc/library/asyncio-task.rst
@@ -359,6 +359,14 @@ and reliable way to wait for all tasks in the group to finish.
359
:meth:`cancel` is idempotent and may be called after the task group has
360
already exited.
361
362
+ Ways to use :meth:`cancel`:
363
+
364
+ * call it from the task group body based on some condition or event
365
+ * pass the task group instance to child tasks via :meth:`create_task`, allowing a child
366
+ task to conditionally cancel the entire entire group
367
+ * pass the task group instance or bound :meth:`cancel` method to some other task *before*
368
+ opening the task group, allowing remote cancellation
369
370
.. versionadded:: next
371
372
Example::
0 commit comments