Skip to content
中文

Transport & streaming ​

Support · Recommended implementations & strategies · Back to layer index

SymbolKindPurpose
encodeSseEventfunctionEncode one event in the server-sent events wire format. Every line of data gets its own data: field, because a raw newline would start a new field.
JsonFrameLimitsinterfaceBounds applied while scanning a streamed text.
JsonTransportParttypeOne scanned span: a complete object frame or a character outside any frame.
parseJsonFramesfunctionParse complete object frames under explicit count and size limits. Only whitespace may appear outside frames; a stray closing brace is tolerated only up to maxExtraClosings, which covers transports that repeat the delimiter after the payload.
scanJsonObjectFramesfunctionExtract complete object-shaped spans from surrounding text, without parsing or selecting them.
SseOutputEventinterfaceOne outbound event before wire encoding.
SseWriterinterfaceDestination that reports backpressure instead of buffering without bound.
writeSseFramefunctionWrite one encoded frame and wait for drain when the writer reports backpressure. The signal is re-checked around the write and the drain wait, so cancellation does not leave a pending write considered successful.

API reference, usage examples and developer guides.