#[non_exhaustive]pub enum RecoveryAction {
Nothing {
phase: TurnPhase,
},
RestartInterpretation,
ResumeCommands {
entries: Vec<CommandJournalEntry>,
},
RegenerateResponse {
events: Vec<StoredEvent>,
answer_tasks: Vec<AnswerTask>,
},
ReconcileExternal {
attempts: Vec<AttemptId>,
entries: Vec<CommandJournalEntry>,
},
}Expand description
What recovery decided to do with a turn (spec §23.1).
“Unfinished” is not quite the right word for what this covers, and the
difference matters: a turn can be TurnPhase::Delivered — the user has a
truthful answer, saying the request is being verified — while an external
effect it started is still unsettled. Recovery therefore looks at the
journal before it looks at the phase.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Nothing
The turn is finished; there is nothing to do.
RestartInterpretation
No command was ever admitted, so nothing can have happened and the turn may be interpreted again from the start.
ResumeCommands
Commands were admitted and not settled. They are resumed by idempotency key: handing the executor these entries lets it recognise what already ran instead of running it twice (I14).
Fields
entries: Vec<CommandJournalEntry>The entries to resume, in admission order.
RegenerateResponse
Everything that was going to commit has committed. The response is rebuilt from the ledger and the stored plan, and nothing is executed.
Fields
events: Vec<StoredEvent>The events the turn committed, in append order.
answer_tasks: Vec<AnswerTask>The questions the turn planned, as answer tasks.
ReconcileExternal
An external effect may or may not have happened. It is settled against the remote system by attempt identifier, never repeated blindly (I15).
Implementations§
Source§impl RecoveryAction
impl RecoveryAction
Sourcepub const fn may_cause_effects(&self) -> bool
pub const fn may_cause_effects(&self) -> bool
Returns true when acting on this decision may cause a domain effect.
Only Self::ResumeCommands can, and even then only through the
idempotency key.