pub struct WebSocketManager { /* private fields */ }Expand description
WebSocket manager for real-time event streaming (v0.2 feature)
Implementations§
Source§impl WebSocketManager
impl WebSocketManager
pub fn new() -> Self
Sourcepub fn with_config(config: WebSocketConfig) -> Self
pub fn with_config(config: WebSocketConfig) -> Self
Create a WebSocket manager with custom backpressure configuration.
Sourcepub fn broadcast_event(&self, event: Arc<Event>)
pub fn broadcast_event(&self, event: Arc<Event>)
Broadcast an event to all connected WebSocket clients
Sourcepub fn subscribe_events(&self) -> Receiver<Arc<Event>>
pub fn subscribe_events(&self) -> Receiver<Arc<Event>>
Subscribe to the event broadcast channel (used by RESP3 SUBSCRIBE).
Sourcepub async fn handle_socket(&self, socket: WebSocket)
pub async fn handle_socket(&self, socket: WebSocket)
Handle a new WebSocket connection (fire-and-forget, no consumer tracking)
Sourcepub async fn handle_socket_with_consumer(
&self,
socket: WebSocket,
consumer_id: String,
store: Arc<EventStore>,
)
pub async fn handle_socket_with_consumer( &self, socket: WebSocket, consumer_id: String, store: Arc<EventStore>, )
Handle a WebSocket connection with a durable consumer for auto-replay.
Replays all events since the consumer’s last acked position, then switches to real-time delivery. The consumer’s event_type_filters are applied during replay.
Sourcepub fn stats(&self) -> WebSocketStats
pub fn stats(&self) -> WebSocketStats
Get statistics about connected clients
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSocketManager
impl !RefUnwindSafe for WebSocketManager
impl Send for WebSocketManager
impl Sync for WebSocketManager
impl Unpin for WebSocketManager
impl UnsafeUnpin for WebSocketManager
impl !UnwindSafe for WebSocketManager
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