Skip to content

src/dazzle_back/runtime/sse_stream.py

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

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Server-Sent Events (SSE) streaming infrastructure.

Provides SSE endpoints that subscribe to the EventBus and stream events to clients in real-time. This leverages the existing Kafka-shaped EventBus abstraction (DevBusMemory, KafkaBus) for event delivery.

Key features: - Multiple named streams (hea...

Key Exports

  • StreamType
  • SSEMessage
  • StreamSubscription
  • SSEStreamManager
  • create_sse_routes
  • serialize
  • start
  • stop
  • create_subscription
  • remove_subscription
  • stream
  • get_stats
  • stream_health
  • stream_events
  • stream_api_calls
  • stream_analytics
  • stream_all
  • get_stats

Dependencies

Imports

  • asyncio
  • json
  • logging
  • collections.abc.AsyncGenerator
  • dataclasses.dataclass
  • dataclasses.field
  • datetime.UTC
  • datetime.datetime
  • enum.StrEnum
  • typing.Any
  • uuid.uuid4
  • fastapi.APIRouter
  • fastapi.Header
  • fastapi.Query
  • fastapi.Request
  • fastapi.responses.StreamingResponse

Event Interactions

Emits: SSEMessage

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.