WindowCleanupCascade

Struct WindowCleanupCascade 

Source
pub struct WindowCleanupCascade {
    closed_label: String,
    drained_pool: Option<bool>,
    phase: Phase,
}
Expand description

Window-cleanup-cascade saga: fires once per window close, drives the implicit pane-reap + pool-drain-decision flow into an explicit two-step state machine, then completes.

Fields§

§closed_label: String

Label of the window that closed (the trigger event’s payload). The saga uses this for label-matching on terminal events: PanesReaped { label } only advances Step 1 when label matches; same for PoolDrained/PoolNotLast in Step 2.

Note: under the coordinator’s evict-and-replace policy, only one window-cleanup-cascade saga is ever in flight at a time, so label-matching is technically redundant for correctness. Keep it anyway as cheap defense-in-depth + a clear invariant-statement: “this saga belongs to this window’s cleanup, not whoever’s terminal event happens to land first.”

§drained_pool: Option<bool>

Whether the host’s drain decision said “yes, that was the last window” (PoolDrained arm) or “no, more windows remain” (PoolNotLast arm). None until Step 2 resolves. Exported for tests.

§phase: Phase

Implementations§

Source§

impl WindowCleanupCascade

Source

pub fn new(closed_label: String) -> Self

Construct a fresh saga for a close of closed_label. Coordinator allocates the saga_id and calls start once.

Trait Implementations§

Source§

impl Saga for WindowCleanupCascade

Source§

fn input_snapshot(&self) -> Value

LSD-2 — record the closing window’s label for --diag sagas. drained_pool is None at start (only known after Step 2) so we don’t include it; the durable log captures the inputs the saga was constructed with, not its evolving state — that lives in step rows.

Source§

fn timeout(&self) -> Duration

CPD-3 — override the default 5s saga timeout. Pane drain (Stage 1 of wrr’s two-stage close cascade) on a workspace with many panes can legitimately take longer than 5s. Per SPEC_CROSS_PROCESS_DISPATCH §3.10.

Source§

fn name(&self) -> &'static str

Source§

fn start(&mut self, _ctx: &SagaCtx) -> SagaAction

Source§

fn on_event(&mut self, event: &Event, ctx: &SagaCtx) -> SagaAction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more