Host-parameterized runner for Stepwise executions.
The runner owns the FSM walk, wait/resume loop, control checks, checkpoint hooks, and canonical event emission. Hosts provide persistence, live publication, and control-state implementations through adapter modules.
start/3 returns as soon as the runner process has offered itself to the
control store and emitted :started; the engine's init/2, which runs
the first step's entry action, runs in that process, not in the caller.
Everything that happens from the first step on, an init failure
included, arrives as events.
Summary
Functions
Starts a run of spec and returns {:ok, execution_id} once its runner
process has offered itself to the control store (a store that fails is
logged, not fatal) and emitted :started.
Types
Functions
Starts a run of spec and returns {:ok, execution_id} once its runner
process has offered itself to the control store (a store that fails is
logged, not fatal) and emitted :started.
The runner then calls the engine's init/2 (the first step's entry
action) itself, so a long first step never blocks the caller. Its outcome
arrives as events: an initial state that is ready runs on; one that waits
is checkpointed and emits its wait (:checkpoint or :paused) like any
later step; an init error, the entry action's or the spec's, marks the run
failed and emits :step_failed and :paused with the reason, as does an
init that raises ({:init_raised, message}), throws ({:init_threw, value}), exits ({:init_exited, reason}) or returns an unexpected value
({:unexpected_init_result, value}). A runner that does not report
started within a second is stopped, and the call returns
{:error, :runner_start_timeout}.