pub struct EventBroadcaster { /* private fields */ }Expand description
EventBroadcaster implements EventSender. It holds a reference to the session map and queues events into per-session outboxes; the server loop drains the outboxes into the WebSocket while holding the session lock.
Events are NEVER written to the socket directly here: a command dispatch
running inside CdpSession::process may emit events for that very
session — taking the session lock here would self-deadlock the server
loop. Outbox + drain-at-send-time preserves the domain gating (applied
when the drain holds the session).
Implementations§
Trait Implementations§
Source§impl Clone for EventBroadcaster
impl Clone for EventBroadcaster
Source§impl EventSender for EventBroadcaster
impl EventSender for EventBroadcaster
Source§fn send_session_event(&self, session_id: &str, method: &str, params: Value)
fn send_session_event(&self, session_id: &str, method: &str, params: Value)
Session-scoped event (flattened CDP sessions): the event JSON carries
sessionId, so clients route it to the attached target session.
Delivered to browser-endpoint sessions (they own the flat sessions).
Source§fn send_event(&self, method: &str, params: Value)
fn send_event(&self, method: &str, params: Value)
Broadcast an event to all sessions that have enabled the domain
extracted from
method (format: “Domain.eventName”).Auto Trait Implementations§
impl Freeze for EventBroadcaster
impl RefUnwindSafe for EventBroadcaster
impl Send for EventBroadcaster
impl Sync for EventBroadcaster
impl Unpin for EventBroadcaster
impl UnsafeUnpin for EventBroadcaster
impl UnwindSafe for EventBroadcaster
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more