Skip to main content

NotificationDispatcher

Trait NotificationDispatcher 

Source
pub trait NotificationDispatcher: Send + Sync {
    // Required method
    fn dispatch(
        &self,
        session_id: &str,
        title: &str,
        body: &str,
        priority: &str,
        url: Option<&str>,
    );
}
Expand description

Port the notify tool dispatches through. Implemented server-side by an adapter with real access to NotificationService, the session broadcast channels, and configured delivery sinks (desktop/ntfy/bark).

dispatch is deliberately synchronous and fire-and-forget — it mirrors bamboo_server::notify_sinks::NotificationSink::deliver: the real classify/dedup/broadcast/sink work happens off this call (a spawned task), so a slow or unreachable delivery channel can never stall the agent loop. Consequently the tool can only ever confirm a request was ATTEMPTED via currently-enabled channels, never that it was delivered.

Required Methods§

Source

fn dispatch( &self, session_id: &str, title: &str, body: &str, priority: &str, url: Option<&str>, )

priority is always one of "low" | "normal" | "high" (validated by NotifyTool::invoke before this is called). url is an optional click-through link for push channels that support one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§