传输与流
Support · 推荐实现与策略 · 返回本层目录
| 符号 | 类别 | 用途 |
|---|---|---|
encodeSseEvent | function | Encode 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. |
JsonFrameLimits | interface | Bounds applied while scanning a streamed text. |
JsonTransportPart | type | One scanned span: a complete object frame or a character outside any frame. |
parseJsonFrames | function | Parse 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. |
scanJsonObjectFrames | function | Extract complete object-shaped spans from surrounding text, without parsing or selecting them. |
SseOutputEvent | interface | One outbound event before wire encoding. |
SseWriter | interface | Destination that reports backpressure instead of buffering without bound. |
writeSseFrame | function | Write 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. |