Skip to content

src/dazzle_back/runtime/websocket_manager.py

Generated: 2026-03-30T04:38:48.638069+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

WebSocket manager for DNR real-time features.

Provides connection management, channel subscriptions, and message routing.

Key Exports

  • MessageType
  • RealtimeMessage
  • Connection
  • WebSocketManager
  • create_websocket_manager
  • to_dict
  • from_dict
  • update_heartbeat
  • register_handler
  • connect
  • disconnect
  • get_connection
  • get_user_connections
  • connection_count
  • channel_count
  • subscribe
  • unsubscribe
  • get_channel_subscribers
  • is_subscribed
  • handle_message

Dependencies

Imports

  • __future__.annotations
  • time
  • uuid
  • collections.abc.Awaitable
  • collections.abc.Callable
  • dataclasses.dataclass
  • dataclasses.field
  • datetime.UTC
  • datetime.datetime
  • enum.StrEnum
  • typing.TYPE_CHECKING
  • typing.Any
  • fastapi.WebSocket

Event Interactions

Emits: RealtimeMessage

Consumes: RealtimeMessage

Invariants and Assumptions

No invariants documented.

Tests

  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py
  • tests/unit/test_runtime_mcp_tools.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.