diff options
Diffstat (limited to 'Doc/library/asyncio-task.rst')
-rw-r--r-- | Doc/library/asyncio-task.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 72fae5e..d85dddf 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -528,6 +528,28 @@ Task functions the event loop object used by the underlying task or coroutine. If it's not provided, the default event loop is used. + +.. function:: current_task(loop=None): + + Return the current running :class:`Task` instance or ``None``, if + no task is running. + + If *loop* is ``None`` :func:`get_running_loop` is used to get + the current loop. + + .. versionadded:: 3.7 + + +.. function:: all_tasks(loop=None): + + Return a set of :class:`Task` objects created for the loop. + + If *loop* is ``None`` :func:`get_event_loop` is used for getting + current loop. + + .. versionadded:: 3.7 + + .. function:: as_completed(fs, \*, loop=None, timeout=None) Return an iterator whose values, when waited for, are :class:`Future` |