class documentation

class AsyncTaskMixin:

View In Hierarchy

Mixin for reliable tracking of fire-and-forget asyncio tasks.

Avoids such tasks disappearing while executing when garbage collected (https://docs.python.org/3/library/asyncio-task.html#creating-tasks).

Async Method _cancel_tasks Cancel and await all tracked tasks.
Method _create_task Schedule and track a background coroutine.
Instance Variable __tasks Undocumented
Property _pending_tasks Return currently running tracked tasks.
async def _cancel_tasks(self):

Cancel and await all tracked tasks.

def _create_task(self, coro: Coroutine[Any, Any, None], *, name: str):

Schedule and track a background coroutine.

The coroutine must return None.

__tasks: set[asyncio.Task[None]] | None =

Undocumented

@property
_pending_tasks: set[asyncio.Task[None]] =

Return currently running tracked tasks.