SagaActionRunner

Trait SagaActionRunner 

Source
pub trait SagaActionRunner: Send + Sync {
    // Required methods
    fn spawn_pool_window(&self) -> String;
    fn reap_panes(&self, label: &str);
    fn drain_pool_if_last(&self, label: &str) -> bool;
}
Expand description

Dispatcher trait — abstracted so tests can inject a fake action runner without spawning real CEF windows. Production code uses LiveActionRunner which calls into commands::window_pool / host close-path code.

Required Methods§

Source

fn spawn_pool_window(&self) -> String

Run the SpawnPoolWindow action. Returns the resulting pool window label (the host normally synthesizes a window-pool-<uuid> label; for the saga reply we report “pending” so the launcher reducer can correlate the follow-up ReportPoolWindowAdded organic event by saga_id). In production the spawn is fire-and-forget on the UI thread — the actual label is reported via the existing organic report_pool_window_added path. The saga’s Report here carries an empty/sentinel label indicating “spawn requested, pool will fill asynchronously.”

Source

fn reap_panes(&self, label: &str)

Run the ReapPanes action for the named window. In current architecture the host’s on_before_close already drains panes synchronously when a window closes, so this is a best-effort acknowledge — the saga relies on the organic Event::PanesReaped (via report_panes_reaped in client.rs) for the real signal. The Report this returns is a saga-correlated echo so the saga’s expected_saga_id filter matches.

Source

fn drain_pool_if_last(&self, label: &str) -> bool

Run the DrainPoolIfLast action for the named window. Returns true if the host considers label to have been the last user-visible window (i.e. a drain WOULD be triggered). Like reap_panes, the host’s existing on_before_close already does this decision inline; the saga’s command path is a re-issue / confirmation channel.

Implementors§

Source§

impl SagaActionRunner for LiveActionRunner

Available on Windows only.