Resume Outcome
Outcome of a ca.acendas.kstate.saga.StatefulSagaExecutor.resume call.
Case summary
| Case | Meaning |
|---|---|
| Resumed | Run was found in the journal and its terminal state was decoded. |
| Indeterminate | Journal is intact but the last Intent has no effect-key; cannot determine whether the side effect fired. |
| NotFound | No entries exist for this RunId. |
| CorruptJournal | Journal integrity is broken (seq gap, codec failure, reducer threw, etc.). |
Usage
when (val outcome = executor.resume(runId, ctx, journal)) {
is ResumeOutcome.Resumed -> process(outcome.result, outcome.state)
is ResumeOutcome.Indeterminate -> alert("ambiguous state at ${outcome.lastPhase}")
is ResumeOutcome.NotFound -> startFresh()
is ResumeOutcome.CorruptJournal -> quarantine(outcome.runId, outcome.reason)
}Content copied to clipboard
Parameters
R
The result type produced by the saga.
S
The saga state type.
Inheritors
Types
Link copied to clipboard
data class CorruptJournal(val runId: RunId, val atSeq: Long, val reason: String) : ResumeOutcome<Nothing, Nothing>
Journal integrity is broken and the run cannot be safely resumed.
Link copied to clipboard
data class Indeterminate<S>(val lastPhase: EntryPhase, val atStep: TypedValue?, val state: S, val reason: String) : ResumeOutcome<Nothing, S>
The journal is intact up to this point but continuation is ambiguous.
Link copied to clipboard
data class Resumed<R, S>(val result: R, val state: S, val terminal: TerminalOutcome) : ResumeOutcome<R, S>
The run was found and its outcome decoded.