Pure Server-Sent-Events frame decoder for the Managed Agents event stream.
decode/1 takes an accumulated buffer and returns {events, remainder} where
events are the decoded JSON maps for every complete frame in the buffer and
remainder is the trailing partial frame to prepend to the next chunk. No
network, no state — call it repeatedly as bytes arrive.
Summary
Functions
Decode complete SSE frames from buffer.
Functions
Decode complete SSE frames from buffer.
Frames are separated by a blank line (\n\n or \r\n\r\n). Within a
frame, data: lines are concatenated with newlines and JSON-decoded. Comment
lines (starting :) and non-data: lines are ignored. Undecodable JSON is
dropped.