INNER CODE UNIT · Python
disconnect
airweave-ai/error-monitoring-agent · backend/main.py:82
def disconnect(self, websocket: WebSocket):
self.active_connections.remove(websocket)
logger.info(f"Client disconnected. Total connections: {len(self.active_connections)}")
async def broadcast(self, message: dict):
"""Send message to all connected clients."""
for connection in self.active_connections:
try:
await connection.send_json(message)
except Exception as e:
logger.error(f"Error sending message: {e}")
manager = ConnectionManager()
# --- Pipeline Execution ---