Skip to content

feat: migrate queue system from Socket.IO to SSE

Ahlad Pataparla requested to merge socket-cleanup into socket-to-sse

Replace Socket.IO real-time updates with Server-Sent Events (SSE) for the consultation queue system. This simplifies the architecture and removes the Socket.IO dependency.

Changes:

  • Remove python-socketio and aiohttp from pyproject.toml
  • Add sse-starlette>=3.3.2 dependency
  • Replace SocketIO ASGI app with FastAPI lifespan context
  • Add SSE endpoint at /api/v1/queue/stream
  • Implement SSE manager with room-based broadcasting
  • Update all services to use SSE broadcast_queue_update
  • Add thread-safe async task execution via global event loop
  • Delete old WebSocket and SocketIO managers
  • Add SSE tests and stress test script

Co-Authored-By: Claude Opus 4.6 [email protected]

Merge request reports

Loading