Chunked Server-Sent Events (text/event-stream) transport loop.
Handles:
- Optional
Last-Event-IDheader /last_event_idquery parameter parsing. - Initial atomic
snapshotor missedcommitring replay. - Zero-copy
ProcBin {:commit_frame, seq, bin}and ID-less{:ephemeral_frame, bin}streaming. - Bounded slow-client backpressure via mailbox drain and fresh
snapshotreplacement. - Periodic
: keepalivecomments and clean exit on socket write error or{:close_sse, reason}.
Summary
Functions
Subscribes the current request process to (sid, cid) via daemon and streams
SSE frames until the client disconnects or {:close_sse, reason} is received.
Subscribes the current request process to catalog session events via daemon
and streams initial snapshot + live catalog SSE frames until the client
disconnects or {:close_sse, reason} is received.
Functions
@spec stream(Plug.Conn.t(), String.t(), String.t(), keyword()) :: Plug.Conn.t()
Subscribes the current request process to (sid, cid) via daemon and streams
SSE frames until the client disconnects or {:close_sse, reason} is received.
@spec stream_sessions(Plug.Conn.t(), keyword()) :: Plug.Conn.t()
Subscribes the current request process to catalog session events via daemon
and streams initial snapshot + live catalog SSE frames until the client
disconnects or {:close_sse, reason} is received.