GenDurable.Executor (gen_durable v0.1.0)

Copy Markdown View Source

Runs one picked instance to a committed outcome (spec §3/§4).

Resolves the FSM module, loads the jsonb state into the FSM's struct, snapshots the signal inbox, calls step/2 under try. A raised exception routes to handle/2 (spec §4.2); if handle/2 itself raises, the instance fails. A worker crash (no return at all) is not handled here — it is the reaper's job (spec §4.3), the at-least-once safety floor.

Consumed signals are deleted in the outcome transaction. Per the agreed semantics, the engine deletes exactly the snapshotted inbox except on an :await outcome, where the instance stays parked and the inbox is preserved (so a non-matching signal survives until its own await, spec §5).

Summary

Functions

Execute job (a map returned by Queries.pick/5). config is %{repo: ...}. Returns the validated outcome tuple.

Functions

run(config, job)

Execute job (a map returned by Queries.pick/5). config is %{repo: ...}. Returns the validated outcome tuple.