pub struct StatusBroadcaster { /* private fields */ }Expand description
Daemon-wide status broadcaster.
Producers (fetch, lifecycle, etc.) call publish to update the
current state. Subscribers (admin clients) connect to the admin
socket; each gets a snapshot of the current state on connect, then
the live event stream.
Implementations§
Source§impl StatusBroadcaster
impl StatusBroadcaster
Sourcepub fn new(initial: StatusEvent) -> Self
pub fn new(initial: StatusEvent) -> Self
Build a fresh broadcaster seeded with initial. Typical
initial value is StatusEvent::Starting.
Sourcepub fn publish(&self, event: StatusEvent)
pub fn publish(&self, event: StatusEvent)
Publish a new state. Updates the snapshot (so subsequent connects see this) AND fans out to all current subscribers.
Sourcepub fn current(&self) -> StatusEvent
pub fn current(&self) -> StatusEvent
Snapshot of the current state. Used by the admin accept loop to write the first frame on connect.
Sourcepub fn latest_capabilities(&self) -> Option<StatusEvent>
pub fn latest_capabilities(&self) -> Option<StatusEvent>
Most recent capability advertisement, if any. The admin accept loop writes this before the snapshot frame so one-shot readers see capabilities even when they connect after Ready.
Sourcepub fn subscribe(&self) -> Receiver<StatusEvent>
pub fn subscribe(&self) -> Receiver<StatusEvent>
Subscribe to the live event stream. The receiver yields every event published after this call.
Trait Implementations§
Source§impl Clone for StatusBroadcaster
impl Clone for StatusBroadcaster
Source§fn clone(&self) -> StatusBroadcaster
fn clone(&self) -> StatusBroadcaster
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more