pub enum SagaAction {
IssueCmd {
target: PipeTarget,
cmd: Command,
},
Done,
Failed {
reason: String,
},
Wait,
}Expand description
What a saga decides to do next, returned from start /
on_event. The coordinator drives the saga forward by reacting
to this enum.
F.7 cleanup audit: IssueCmd, Done, Wait are all constructed
by F.5 + F.6 sagas. Failed is consumed in apply_action (and
its corresponding emit_failed is now actively called by the
evict-and-replace path), but no shipped saga constructs
Failed yet — sagas today only succeed or wait. Variant-level
allow scopes the dead-code suppression precisely to that one
reserved variant.
Variants§
IssueCmd
Dispatch a command on the target pipe; saga remains in flight.
Done
Saga succeeded. Coordinator removes it from in_flight
and emits Event::SagaCompleted.
Failed
Saga failed irrecoverably. Coordinator emits Event::SagaFailed
after dispatching any compensation IssueCmds the saga issued
before returning Failed. Reserved for sagas with explicit
failure conditions (e.g. cross-process dispatch follow-up
- saga timeouts).
Wait
Saga is waiting for an event it hasn’t seen yet. No-op for the coordinator until the next bus event.