pub struct WebSocketManager { /* private fields */ }
Expand description
WebSocket manager for handling real-time dashboard connections
Implementations§
Source§impl WebSocketManager
impl WebSocketManager
pub fn new(dashboard_service: Arc<DashboardService>) -> Self
Sourcepub async fn handle_websocket(&self, ws: WebSocketUpgrade) -> Response
pub async fn handle_websocket(&self, ws: WebSocketUpgrade) -> Response
Handle new WebSocket connection
Sourcepub async fn broadcast_statistics_update(
&self,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn broadcast_statistics_update( &self, ) -> Result<(), Box<dyn Error + Send + Sync>>
Broadcast statistics update to all connected clients
Sourcepub async fn broadcast_job_update(
&self,
job_id: String,
state: String,
updated_at: String,
)
pub async fn broadcast_job_update( &self, job_id: String, state: String, updated_at: String, )
Broadcast job update to all connected clients
Sourcepub async fn connected_clients_count(&self) -> usize
pub async fn connected_clients_count(&self) -> usize
Get number of connected clients
Sourcepub async fn start_periodic_updates(&self, interval_seconds: u64)
pub async fn start_periodic_updates(&self, interval_seconds: u64)
Start periodic statistics broadcast
Auto Trait Implementations§
impl Freeze for WebSocketManager
impl !RefUnwindSafe for WebSocketManager
impl Send for WebSocketManager
impl Sync for WebSocketManager
impl Unpin 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