Skip to main content

Module context

Module context 

Source
Expand description

Shared execution context passed to every task.

A Context is created once per run and shared (via Arc) across all tasks. It provides three things tasks commonly need:

  • a typed key/value blackboard for passing data between tasks,
  • cooperative cancellation (e.g. for graceful shutdown),
  • a lightweight event bus used by crate::tasks::EventDrivenTask.

Structsยง

CancelToken
A cooperative cancellation token.
Context
Per-run shared state handed to tasks.