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: u32Auto Trait Implementations§
impl !RefUnwindSafe for InFlightSaga
impl !Sync for InFlightSaga
impl !UnwindSafe for InFlightSaga
impl Freeze for InFlightSaga
impl Send for InFlightSaga
impl Unpin for InFlightSaga
impl UnsafeUnpin for InFlightSaga
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.