pub struct SseManager { /* private fields */ }
Expand description
SSE connection manager
Implementations§
Source§impl SseManager
impl SseManager
Sourcepub async fn create_connection(&self, connection_id: String) -> SseConnection
pub async fn create_connection(&self, connection_id: String) -> SseConnection
Create a new SSE connection
Sourcepub async fn remove_connection(&self, connection_id: &str)
pub async fn remove_connection(&self, connection_id: &str)
Remove a connection
Sourcepub async fn send_error(&self, message: String)
pub async fn send_error(&self, message: String)
Send error to all connections
Sourcepub async fn send_keep_alive(&self)
pub async fn send_keep_alive(&self)
Send keep-alive ping
Sourcepub async fn connection_count(&self) -> usize
pub async fn connection_count(&self) -> usize
Get number of active connections
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SseManager
impl !RefUnwindSafe for SseManager
impl Send for SseManager
impl Sync for SseManager
impl Unpin for SseManager
impl !UnwindSafe for SseManager
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