# Flow F3 — Real-time SSE Subscription Cross-reference: `system-flows.md` → Flow F3. ## Sequence ```mermaid sequenceDiagram autonumber participant UI participant Ctrl as AnnotationsController.Events (component 02 doc-ownership) participant Evt as AnnotationEventService (02) participant ProducerF1 as Flow F1 (annotation create) participant ProducerF8 as Flow F8 (dataset bulk status) UI->>Ctrl: GET /annotations/events (Accept: text/event-stream, JWT ANN) Ctrl->>Ctrl: set Content-Type: text/event-stream, no-cache Ctrl->>Evt: ReadAllAsync(cancellationToken) par event sources ProducerF1->>Evt: PublishAsync(eventDto) ProducerF8->>Evt: PublishAsync(eventDto) end Evt-->>Ctrl: yield AnnotationEventDto Ctrl-->>UI: data: {json}\n\n UI--xCtrl: client disconnects Ctrl->>Ctrl: cancellation token fires; loop exits ``` ## State ```mermaid stateDiagram-v2 [*] --> Subscribing Subscribing --> Streaming: header sent + reader attached Streaming --> Streaming: PublishAsync -> data frame Streaming --> Closed: client cancel / process restart Closed --> [*] ``` ## Notes - Channel is **unbounded**: a slow client cannot back-pressure the producer. If a client stalls indefinitely, memory growth is bounded by per-publisher cancellation tokens at the controller level. Step 4 verification candidate. - Cross-pod fan-out is **not provided** — each pod has its own channel. Sticky sessions or a broker-backed bus required for horizontal scale.