Update client_manager.rs

+ created function to get the number of connected clients
This commit is contained in:
michael-bailey 2022-02-28 18:13:27 +00:00
parent 2e74aa058f
commit cfe72b6c7b
1 changed files with 4 additions and 0 deletions

View File

@ -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>) {
use ClientMgrMessage::{Add, Remove, SendClients, BroadcastGlobalMessage, SendError};
println!("Handling channel");