Skip to main content

Module materializer

Module materializer 

Source
Expand description

State materialization — reconstruct current workflow state from events.

Current state = latest_snapshot.state + apply(events since snapshot)

Each NodeCompleted event carries a state_patch (a JSON merge patch, RFC 7396) that is applied in sequence to evolve the workflow’s current_state.

Structs§

MaterializedState
The materialized state of a workflow execution at a point in time.

Functions§

apply_events
Apply a sequence of events on top of a base state to produce MaterializedState.
materialize
Reconstruct the current workflow state from the event log.
should_snapshot
Check whether a snapshot should be taken given the event count since the last snapshot.