ReqServerSentEvents.CollectableWrapper (ReqServerSentEvents v0.2.0)

Copy Markdown View Source

Wraps any Collectable so that raw SSE byte chunks are decoded into %ReqServerSentEvents.Frame{} structs before being collected.

The byte buffer is carried in the accumulator alongside the inner collectable's own accumulator, so no process state is required. Partial frames at end-of-stream are discarded — a frame is only emitted once terminated by "\n\n".