Behaviour for the event-history journal.
Two adapters ship with v0.1:
Continuum.Runtime.Journal.InMemory— process-level state for tests and single-node hello-world. No durability.Continuum.Runtime.Journal.Postgres— Ecto-backed durable journal with transactional appends and lease-token fencing.
All append operations carry a lease_token (or nil for unleased
in-memory / pre-dispatch execution). The Postgres adapter rejects writes
whose token does not match the run row's fencing token; nil only writes
to unleased rows.
Summary
Callbacks
Look up the run record. Returns nil if no such run, or a map with at
least :state, :result, :error keys (atoms / terms — already decoded).
Callbacks
Look up the run record. Returns nil if no such run, or a map with at
least :state, :result, :error keys (atoms / terms — already decoded).
@callback load_with_snapshot( instance :: Continuum.Runtime.Instance.t(), run_id :: binary(), lease_token :: integer() | nil ) :: {Continuum.Snapshot.t() | nil, [map()]}
@callback take_snapshot!( instance :: Continuum.Runtime.Instance.t(), snapshot :: Continuum.Snapshot.t() ) :: :ok