pub struct ChatEventHub { /* private fields */ }websocket only.Expand description
The server-wide source of ephemeral Chat events: the deployment
publishes each event here once, and every connection’s
ChatStreamHandler decides whether its client receives it.
Publish one event per recipient account, with that account as
accountId: for typing, the account holding the recipient’s Chat
record and senderId as the recipient sees it; for presence, the
account holding the recipient’s ChatContact. A connection takes the
events whose accountId is one of its accounts.
The hub keeps the last capacity events for connections that fall
behind; a connection that falls further behind skips the events it
missed, which the draft allows for ephemeral events. Clones share the
hub.
Implementations§
Source§impl ChatEventHub
impl ChatEventHub
Sourcepub fn publish_typing(&self, event: ChatTypingEvent)
pub fn publish_typing(&self, event: ChatTypingEvent)
Offer a ChatTypingEvent to every connection. With none
connected it is dropped.
Sourcepub fn publish_presence(&self, event: ChatPresenceEvent)
pub fn publish_presence(&self, event: ChatPresenceEvent)
Offer a ChatPresenceEvent to every connection. With none
connected it is dropped.