Expand description
Server-wide event stream.
The embedding API exposes a tokio::sync::broadcast of
ServerEvent values so consumers can observe peer
transitions, gossip rounds, configuration reloads, and other
cluster-wide signals. The handle returned by
crate::embed::ServerHandle::subscribe_events wraps the
broadcast receiver in EventStream for ergonomic polling.
Only the engine publishes to the bus; embedding programs
subscribe through EventBus::subscribe and consume via
EventStream::recv / EventStream::try_recv.
§Examples
use dynomite::embed::events::{ConnRoleTag, CloseReason, PeerDownReason, EventBus};
let bus = EventBus::new(16);
let _rx = bus.subscribe();
assert_eq!(bus.subscriber_count(), 1);Structs§
- Event
Bus - Event publisher held by the embed runtime.
- Event
Stream - Pollable async stream of
ServerEvents.
Enums§
- Close
Reason - Reason carried with
ServerEvent::ConnectionClosed. - Conn
Role Tag - Summary tag for the role of a connection at accept time.
- Peer
Down Reason - Reason carried with
ServerEvent::PeerDown. - Server
Event - Cluster-wide event published on the broadcast channel.