-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement unary HTTP calls with retry support
Changes the internal duplexHTTPCall to switch on non streaming client requests to block and wait for the response. This avoids the need to convert the reader to a writer with io.Pipe and the go routine to run asynchronously. On unary requests we are now able to set the `Content-Length` header and the `GetBody` function for retries. To safely reuse the payload buffer a new type `payloadCloser` is added to implement the required HTTP body semantics. On receiving a response the request may still be read up and until the response is body is closed. To ensure the request body is safe to releasee we wait for a complete read or close on the request body. Retries may read, close or rewind the body multiple times before a response is returned.
- Loading branch information
1 parent
52abcce
commit f85fce8
Showing
5 changed files
with
311 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.