pub struct DispatcherOptions {
pub sink: Box<dyn NotificationSink>,
pub settings_rx: Receiver<Settings>,
pub alerts_rx: Receiver<Alert>,
pub shutdown_rx: Receiver<()>,
}Expand description
Dispatcher options for tests + production. Production callers
invoke [DispatcherOptions::production] which carries a
LibNotifySink; tests construct directly with an InMemorySink.
Fields§
§sink: Box<dyn NotificationSink>Box so the dispatcher stays object-safe across InMemorySink
(tests) and LibNotifySink (production).
settings_rx: Receiver<Settings>Live settings snapshot; the dispatcher reads notify_on_complete
/ notify_on_error from the most-recently-broadcast value on
every alert. tokio::sync::watch is the natural fit — exactly
one writer (SessionActor::handle_apply_settings) + many
readers (each cheap clone).
alerts_rx: Receiver<Alert>Broadcast subscription. The dispatcher takes ownership; passing it in lets the caller acquire the subscription BEFORE the dispatcher task is spawned (avoids the missed-alert race on session startup — H5 in the plan).
shutdown_rx: Receiver<()>Shutdown signal: drop the sender or call .send(()) to ask the
dispatcher to exit cleanly.