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

Function display_awaited_by_tasks_table

Lib/asyncio/tools.py:251–262  ·  view source on GitHub ↗

Build and print a table of all pending tasks under `pid`.

(pid: int)

Source from the content-addressed store, hash-verified

249
250
251def display_awaited_by_tasks_table(pid: int) -> None:
252 """Build and print a table of all pending tasks under `pid`."""
253
254 tasks = _get_awaited_by_tasks(pid)
255 table = build_task_table(tasks)
256 # Print the table in a simple tabular format
257 print(
258 f"{'tid':<10} {'task id':<20} {'task name':<20} {'coroutine stack':<50} {'awaiter chain':<50} {'awaiter name':<15} {'awaiter id':<15}"
259 )
260 print("-" * 180)
261 for row in table:
262 print(f"{row[0]:<10} {row[1]:<20} {row[2]:<20} {row[3]:<50} {row[4]:<50} {row[5]:<15} {row[6]:<15}")
263
264
265def display_awaited_by_tasks_tree(pid: int) -> None:

Callers

nothing calls this directly

Calls 2

_get_awaited_by_tasksFunction · 0.85
build_task_tableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…