Spectre.Effect.Executor behaviour (Spectre v0.3.0)

Copy Markdown View Source

Safe capability port for extension-owned, non-action effects.

Executors perform external work and return an outcome. They never mutate Spectre.State; Spectre.Execution remains the sole owner of policy, durable replay, and terminal lifecycle transitions.

Summary

Functions

Dispatches one non-action effect through its Agent extension.

Types

result()

@type result() :: {:ok, term()} | {:error, term()}

Callbacks

execute(t, t, keyword)

@callback execute(Spectre.Effect.t(), Spectre.Context.t(), keyword()) :: result() | term()

Functions

dispatch(effect, ctx, opts \\ [])

@spec dispatch(Spectre.Effect.t(), Spectre.Context.t() | map(), keyword()) :: result()

Dispatches one non-action effect through its Agent extension.