PyDocs

Nav

Networking and Interprocess Communication

Task.get_stack

asyncio

method of Tasknot WASI
  • Task.get_stack(*, limit=None)
Return the list of stack frames for this task's coroutine.

If the coroutine is not done, this returns the stack where it is
suspended.  If the coroutine has completed successfully or was
cancelled, this returns an empty list.  If the coroutine was
terminated by an exception, this returns the list of traceback
frames.

The frames are always ordered from oldest to newest.

The optional limit gives the maximum number of frames to
return; by default all available frames are returned.  Its
meaning differs depending on whether a stack or a traceback is
returned: the newest frames of a stack are returned, but the
oldest frames of a traceback are returned.  (This matches the
behavior of the traceback module.)

For reasons beyond our control, only one stack frame is
returned for a suspended coroutine.
0 Examples
No examples for asyncio/Task.get_stack.
See Also
No see-alsos for asyncio/Task.get_stack
0 Notes
No notes for Task.get_stack