Repository navigation
Run Client::call on the direct path and let the client implement the shared request interface. - #81
Merged
Merged
Conversation
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.
Replace the buffered
Client::callwith one on the direct path, asdesign/middleware.mddecides: it opens the request with the body's known length, writes the body from the calling future while waiting for the response head, and returns the direct path'sStreamingResponseBody; an upload unfinished at the head moves to the driver as one work item, whose waiting reads stop when the exchange is cancelled.ClientimplementsHandler<'scope, ClientContext<I>>, relaying interim responses to the context's observer through anInterimRelay, andcall_with_interimis removed. The driver's queue of operations, the boxed request-body producer,ResponseBodyandOptions::response_buffer_bytesandresponse_buffer_framesare removed, and connection sessions only wait to be stopped. Behaviour changes:callmakes progress only while polled, asopendoes; response bodies stream from the connection and cannot outlive the client's scope; protocol errors on response bodies are no longer wrapped as body failures; closing a response body with an error makes later reads report it; a streaming body known to be empty is ready; and a connection under construction when the driver shuts down is cancelled rather than retired late, so a failure closing it reports the cancellation. Waiting calls still reportClosedwhen the driver is dropped andCancelledwhen its lifetime is cancelled. Twelve client tests that assumed the driver sends a request after one poll now drive the call until the peer reaches the intended point, using a newdrive_untilhelper, and new tests cover a failed upload write, a rejected call through the interface and acquiring from a closed pool. The client benchmark measured the newcallat the direct writer's cost, 7 allocations and about 600 bytes per request against 17 to 18 and over 5 KB before, with 24 to 29 percent more requests per second; the full suite passes on Rust 1.92 and 1.99, region coverage is complete, and both client examples run over HTTP and HTTPS.