Skip to main content

Module context

Module context 

Source
Expand description

Execution context and cancellation boundary types.

§Fragment: context-runtime-boundary

This module keeps the runtime-facing context deliberately small: workflow identity, node identity, execution identity, and cancellation state. That is enough for the foundation beads to define what a node is executing without prematurely choosing an async runtime, scheduler, or transport.

§Fragment: context-cancellation-shape

Cancellation is represented as a Pureflow-owned shared signal rather than as an exposed async-runtime context. Runtime supervisors can request cancellation after a node starts, and cloned parent or child contexts observe the same request, but node APIs still see only Pureflow NodeContext semantics rather than raw asupersync::Cx.

§Fragment: context-attempt-numbering

Execution attempts are one-based on purpose. Retry counts are usually read by humans in logs and diagnostics, and attempt = 1 is less error-prone than forcing every downstream consumer to translate from zero-based storage.

Structs§

CancellationHandle
Runtime-owned handle that can request cancellation for shared contexts.
CancellationRequest
Cancellation request visible at the runtime boundary.
CancellationToken
Read-only cancellation view carried by a node execution context.
ExecutionAttempt
One-based attempt number for an execution boundary.
ExecutionMetadata
Metadata that identifies one workflow execution attempt.
NodeContext
Minimal execution context passed to runtime-managed nodes.

Enums§

CancellationState
Cancellation state carried by a node execution context.