Repository navigation
Conversation
MisterVVP
merged commit Aug 26, 2026
08c4124
into
dev-optimize-streaming-response-latencies
17 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
SendStreamingMessageresponses truly incremental so the first event is serialized and sent as soon asServerStreamSession::Next()produces it while preserving envelope/ordering/semantics.Description
Transfer-Encoding: chunked) to the transport immediately for reusable streaming responses, then invoke the stream writer; emit the terminal0\r\n\r\nonly after successful completion and avoid emitting it if the writer fails (src/server/transport/http_adapter.cpp).ChunkedByteTransportto avoid large temporary concatenations by formatting the chunk-size into stack storage and performing direct prefix, payload, and terminator writes to the underlying transport (src/server/transport/http_adapter.cpp).BuildStreamingResponse()with astream_writerthat pulls oneStreamResponse, serializes exactly one SSE event, writes it immediately, then requests the next event; session lifetime is moved into writer-owned state (src/server/transport/rest_transport.cpp).StreamFiniteJsonRpcSseEvents()that builds one JSON-RPC success envelope per event (preserving requestid), emits exactly one SSE event, writes it immediately, and repeats until completion (src/server/transport/json_rpc_server_transport.cpp).idand stream incrementally (tests/unit/http_adapter_test.cpp,tests/unit/rest_transport_test.cpp,tests/unit/json_rpc_server_transport_test.cpp).ServerStreamSession::Next()already provides the correct incremental pull semantics andHttpByteTransport::Write()remains synchronous.