StatifierPersistence.Execution (StatifierPersistence v0.12.0)

Copy Markdown View Source

The host-facing view of a durable execution: what state is this execution in - never what its bytes are. The position blob stays on the stored record (ADR-0004 decision 1), loaded only through the guarded StatifierPersistence.Storage.load_execution_position/3 path; this struct carries the fields a host reads to decide what to do with an execution.

Summary

Functions

Builds the host-facing struct from a stored StatifierPersistence.Storage.Adapter.execution_record/0, dropping the two blob fields (identity_blob, position_blob) and carrying everything else verbatim.

Types

t()

@type t() :: %StatifierPersistence.Execution{
  content_hash: StatifierPersistence.Storage.Adapter.content_hash(),
  donedata: term() | nil,
  execution_id: StatifierPersistence.Storage.Adapter.execution_id(),
  failure: String.t() | nil,
  status: StatifierPersistence.Storage.Adapter.execution_status()
}

Functions

from_record(map)

Builds the host-facing struct from a stored StatifierPersistence.Storage.Adapter.execution_record/0, dropping the two blob fields (identity_blob, position_blob) and carrying everything else verbatim.

donedata is always nil here: a stored record carries no donedata (ADR-0008 decision 3) - a position that has reached a final state has no configuration left to carry it, so it exists only on the step that produced it, via StatifierPersistence.Executions' own construction of this struct.