Update client_manager.rs
+ created function to get the number of connected clients
This commit is contained in:
parent
2e74aa058f
commit
cfe72b6c7b
|
|
@ -51,6 +51,10 @@ impl<Out> ClientManager<Out>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn get_count(&self) -> usize {
|
||||||
|
self.clients.lock().await.len()
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn handle_channel(&self, message: Option<ClientMgrMessage>) {
|
pub async fn handle_channel(&self, message: Option<ClientMgrMessage>) {
|
||||||
use ClientMgrMessage::{Add, Remove, SendClients, BroadcastGlobalMessage, SendError};
|
use ClientMgrMessage::{Add, Remove, SendClients, BroadcastGlobalMessage, SendError};
|
||||||
println!("Handling channel");
|
println!("Handling channel");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue