|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Incremental Server-Sent Events parser (WHATWG HTML, "Server-sent events", event stream interpretation). More...
#include <neograph/api.h>#include <cstddef>#include <cstdint>#include <optional>#include <string>#include <string_view>#include <vector>Go to the source code of this file.
Incremental Server-Sent Events parser (WHATWG HTML, "Server-sent events", event stream interpretation).
Pure state machine: bytes in (feed), complete events out (drain). The caller pairs this with a transport that delivers byte chunks (typically async_post_stream), since one HTTP chunk may contain partial, whole, or multiple SSE events.
It follows the WHATWG processing rules, which MCP's Streamable HTTP transport and the official MCP SDKs rely on:
data lines join with LF, and an event with no data line is not dispatched;id sets the last event ID (ignored when it contains NUL), which every later event carries until another id changes it;retry with only ASCII digits sets the reconnection time;Definition in file sse_parser.h.