Compacted history prefix for long-running workflows.
A snapshot does not capture a BEAM continuation. Workflow code still runs from the top; the snapshot only replaces an old prefix of raw journal events with compacted steps that validate the requested effect and return the previously journaled result.
Summary
Functions
Compact a contiguous event list into snapshot steps.
Decode a stored snapshot payload.
Encode a snapshot for storage.
Return the encoded size in bytes.
Current snapshot payload format version.
Types
@type step() :: %{ effect_type: atom(), command_id: term(), shape: term(), result: term(), advance_by: pos_integer() }
@type t() :: %Continuum.Snapshot{ run_id: binary(), steps_by_seq: %{required(non_neg_integer()) => step()}, taken_at: DateTime.t(), through_seq: non_neg_integer(), version_hash: binary() }
Functions
@spec compact(binary(), binary(), [map()], keyword()) :: {:ok, t()} | {:skip, term()} | {:error, term()}
Compact a contiguous event list into snapshot steps.
Pass :base to extend an existing compatible snapshot. If the event list
ends with a pending scheduled/awaited event, the compacted snapshot stops at
the last complete step instead of covering the incomplete tail.
Decode a stored snapshot payload.
Encode a snapshot for storage.
@spec encoded_size(t()) :: non_neg_integer()
Return the encoded size in bytes.
@spec format_version() :: pos_integer()
Current snapshot payload format version.