A revisioned Task aggregate used at persistence and compare-and-set boundaries.
work, retry bookkeeping, input_history, and accepted_input_responses are
private execution state and are never projected onto the Tasks wire shape.
The original request for every lifetime-unique input key remains in
input_history, allowing a recovered worker to distinguish an identical
replay from an ambiguous key reuse. Accepted responses remain persisted when
no local worker is available.
Summary
Types
@type retry_failure() :: map()
@type t() :: %Snodo.Extensions.Tasks.Snapshot{ accepted_input_responses: %{optional(String.t()) => map()}, input_history: %{optional(String.t()) => map()}, last_failure: retry_failure() | nil, retry_at: String.t() | nil, retry_count: non_neg_integer(), revision: non_neg_integer(), task: Snodo.Extensions.Tasks.Task.t(), work: Snodo.Extensions.Tasks.Work.t() | nil }
Functions
Decodes and validates a persistence map produced by to_map/1.
@spec new(Snodo.Extensions.Tasks.Task.t(), Snodo.Extensions.Tasks.Work.t() | nil) :: t()
Creates the initial revision-zero snapshot for a durable Task.
Encodes the complete aggregate as a stable JSON-safe persistence map.