IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

TaskGroupContext

struct TaskGroupContext

Context structure for task group operations.

This structure holds a callback function and a pointer to a TaskGroup, allowing asynchronous operations to interact with their parent TaskGroup when they complete.

Fields

  • callback (def(mut TaskGroup) -> None): Callback function to be invoked on the TaskGroup when an operation completes.
  • task_group (UnsafePointer[TaskGroup, MutExternalOrigin]): Pointer to the TaskGroup that owns or is associated with this context.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

comptime members

tg_callback_fn_type

comptime tg_callback_fn_type = def(mut TaskGroup) -> None

Type definition for callback functions that operate on TaskGroups.