Jido.Exec.Propagation (Jido Action v2.3.0)

View Source

Resolves and applies runtime-context propagators across supervised execution.

jido_action uses this helper to preserve ambient process-local state when it crosses Task.Supervisor boundaries for timeouts, async execution, compensation, and async chains.

Summary

Functions

Captures the configured runtime-context propagators for the current process.

Resolves the configured context propagator modules.

Resolves the effective failure mode for propagator callbacks.

Attaches a captured snapshot while executing fun.

Types

failure()

@type failure() :: {Exception.t(), Exception.stacktrace()}

failure_mode()

@type failure_mode() :: :warn | :strict

propagator()

@type propagator() :: module()

snapshot_entry()

@type snapshot_entry() :: {propagator(), term()}

t()

@type t() :: %Jido.Exec.Propagation{
  entries: [snapshot_entry()],
  failure_mode: failure_mode()
}

Functions

capture(opts \\ [])

@spec capture(keyword()) :: t()

Captures the configured runtime-context propagators for the current process.

context_propagators(opts \\ [])

@spec context_propagators(keyword()) :: [propagator()]

Resolves the configured context propagator modules.

failure_mode(opts \\ [])

@spec failure_mode(keyword()) :: failure_mode()

Resolves the effective failure mode for propagator callbacks.

with_attached(snapshot, fun)

@spec with_attached(t(), (-> result)) :: result when result: term()

Attaches a captured snapshot while executing fun.