pub struct Resolver { /* private fields */ }Expand description
Single durability chokepoint that resolves workflow commands against recorded history.
Implementations§
Source§impl Resolver
impl Resolver
Sourcepub const fn new(workflow_id: WorkflowId, cursor: HistoryCursor) -> Self
pub const fn new(workflow_id: WorkflowId, cursor: HistoryCursor) -> Self
Creates a resolver for one workflow history.
The workflow id is retained for typed non-determinism diagnostics; AD-006 wires the determinism-context timestamp hook at this same chokepoint.
Sourcepub fn resolve(
&mut self,
command: Command,
) -> Result<ResolveOutcome, DurabilityError>
pub fn resolve( &mut self, command: Command, ) -> Result<ResolveOutcome, DurabilityError>
Resolves a command from recorded history or returns ResolveOutcome::ResumeLive.
§Errors
Returns DurabilityError::NonDeterminism when the cursor reports a command-stream
mismatch, or DurabilityError::HistoryShape when matched history lacks one of AD-004’s
recorded terminal outcomes.
Sourcepub fn next_command_ordinal(&self, family: RecordedEventFamily) -> Option<u64>
pub fn next_command_ordinal(&self, family: RecordedEventFamily) -> Option<u64>
Returns the correlation ordinal at the current replay cursor for the requested family.
Sourcepub fn fast_forward_to(&mut self, key: &CorrelationKey)
pub fn fast_forward_to(&mut self, key: &CorrelationKey)
Advance the cursor past commands consumed by earlier resolver
instances of the same live execution. See
HistoryCursor::fast_forward_to_key.
Sourcepub fn fast_forward_to_child_terminal(&mut self, child_workflow_id: &WorkflowId)
pub fn fast_forward_to_child_terminal(&mut self, child_workflow_id: &WorkflowId)
Advance the cursor to the recorded terminal outcome for one awaited
child workflow. See HistoryCursor::fast_forward_to_child_terminal.
Sourcepub fn resolve_with_consumed(
&mut self,
command: Command,
) -> Result<ResolvedCommand, DurabilityError>
pub fn resolve_with_consumed( &mut self, command: Command, ) -> Result<ResolvedCommand, DurabilityError>
Resolves a command and includes the consumed recorded timestamp for replay bookkeeping.
The returned ResolvedCommand preserves the existing recorded/resume-live decision while
exposing the timestamp of the last consumed history event. Replay uses that timestamp as the
only source for advancing workflow-visible now.
§Errors
Returns DurabilityError::NonDeterminism when the cursor reports a command-stream
mismatch, or DurabilityError::HistoryShape when matched history lacks one of AD-004’s
recorded terminal outcomes.