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: StringLabel 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: PhaseImplementations§
Trait Implementations§
Source§impl Saga for WindowCleanupCascade
impl Saga for WindowCleanupCascade
Source§fn input_snapshot(&self) -> Value
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
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.