struct InFlightSaga {
saga: Box<dyn Saga>,
awaiting_step: Option<u32>,
next_step_index: u32,
}Expand description
Saga coordinator task.
Owns the registry of in-flight sagas, allocates saga ids, routes events to sagas, dispatches IssueCmd actions to the appropriate pipes, and emits lifecycle events on the broadcast bus.
F.5 adds the first real consumer (pool_respawn). The
in_flight registry is now actually populated; the bus loop
dispatches events into it.
LSD-2 — coordinator’s per-saga book-keeping. Wraps the boxed saga
with the durable-log step bookkeeping the coordinator needs to call
LauncherSagaLog::finish_step when the awaited bus event lands.
awaiting_step is Some(idx) when the saga is parked on a
Wait-then-event pivot (the most recent IssueCmd allocated step
idx); None between dispatches and after termination. Tracking
it on the in-flight record (rather than inside each saga impl) keeps
the durability concern out of saga authors’ hands — they only deal
with SagaAction.
next_step_index is the monotonic counter the coordinator
fetch_add(1)s on every IssueCmd for this saga. Mirrors srv’s
SagaCtx::step_index. Lives per-saga (not coordinator-global) so
concurrent sagas don’t interleave indices in the log.
Fields§
§saga: Box<dyn Saga>§awaiting_step: Option<u32>§next_step_index: u32