MCPcopy Index your code
hub / github.com/python/cpython / all_tasks

Function all_tasks

Lib/asyncio/tasks.py:44–53  ·  view source on GitHub ↗

Return a set of all tasks for the loop.

(loop=None)

Source from the content-addressed store, hash-verified

42
43
44def all_tasks(loop=None):
45 """Return a set of all tasks for the loop."""
46 if loop is None:
47 loop = events.get_running_loop()
48 # capturing the set of eager tasks first, so if an eager task "graduates"
49 # to a regular task in another thread, we don't risk missing it.
50 eager_tasks = list(_eager_tasks)
51
52 return {t for t in itertools.chain(_scheduled_tasks, eager_tasks)
53 if futures._get_loop(t) is loop and not t.done()}
54
55
56class Task(futures._PyFuture): # Inherit Python Task implementation

Callers

nothing calls this directly

Calls 4

listClass · 0.85
chainMethod · 0.80
_get_loopMethod · 0.80
doneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…