Remove a connection when session ends
(&self, session_id: &Uuid)
| 142 | |
| 143 | /// Remove a connection when session ends |
| 144 | pub fn remove_connection(&self, session_id: &Uuid) { |
| 145 | // Remove from thread-local cache first |
| 146 | ThreadLocalConnectionCache::remove(session_id); |
| 147 | |
| 148 | let mut connections = self.connections.write(); |
| 149 | if connections.remove(session_id).is_some() { |
| 150 | info!("Removed connection for session {} (remaining connections: {})", session_id, connections.len()); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /// Get the number of active connections |
| 155 | pub fn active_connections(&self) -> usize { |
no test coverage detected