Server-sent event framing.
The transport hands over body chunks; this module turns them into data
payloads. Only data: matters to the codecs — event:, id:, retry:, and
comment lines are ignored — and multiple data: lines in one event are joined
with a newline, as the SSE specification requires.
A chunk may split a line or an event; the remainder is kept in buffer until
the next chunk. flush/1 returns a trailing event that arrived without its
terminating blank line, and an empty buffer when the body ended cleanly.
{payloads, state} = SSE.parse(state, chunk)
Summary
Functions
Returns the event left in the buffer at end of body, if any.
Parses one body chunk into the events it completes.
Types
Functions
Returns the event left in the buffer at end of body, if any.
Providers terminate events with a blank line, so this is normally empty; it exists so a truncated stream does not lose its last event.
@spec new() :: t()
Parses one body chunk into the events it completes.