INNER CODE UNIT · Python
ConnectionManager
permitio/fastapi_websocket_rpc · fastapi_websocket_rpc/connection_manager.py:6
class ConnectionManager:
def __init__(self):
self.active_connections: List[WebSocket] = []
async def connect(self, websocket: WebSocket):
await websocket.accept()
self.active_connections.append(websocket)
def disconnect(self, websocket: WebSocket):
self.active_connections.remove(websocket)