dataflow.internal_websockets.manager¶

Attributes¶

Classes¶

ConnectionManager

Manager for WebSocket connections.

Module Contents¶

class dataflow.internal_websockets.manager.ConnectionManager¶

Manager for WebSocket connections.

async authenticate(websocket: fastapi.WebSocket) str | None¶

Authenticate a WebSocket connection.

Parameters:

websocket (fastapi.WebSocket) – The WebSocket connection

Returns:

User ID if authenticated, None otherwise

Return type:

str | None

async connect(websocket: fastapi.WebSocket, thread_id: str) str | None¶

Connect a client to a thread.

Parameters:
  • websocket (fastapi.WebSocket) – The WebSocket connection

  • thread_id (str) – Thread/conversation ID

Returns:

Connection ID if successful, None otherwise

Return type:

str | None

disconnect(thread_id: str, connection_id: str) None¶

Disconnect a client from a thread.

Parameters:
  • thread_id (str) – Thread/conversation ID

  • connection_id (str) – Connection ID

Return type:

None

active_connections: dict[str, dict[str, fastapi.WebSocket]]¶
auth¶
user_connections: dict[str, set[str]]¶
dataflow.internal_websockets.manager.logger¶