-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ios: add request unary interfaces (#347)
Adds unary interfaces (related to envoyproxy/envoy-mobile#118) which will call into the streaming interfaces under the hood. These are to be used as convenience convenience accessors for the common case of non-streaming requests, and will be added on Android as part of envoyproxy/envoy-mobile#119. This also removes `data` and `trailers` from `Request`, as the unary function will take care of this for unary requests, and streams will be expected to handle this through the `StreamEmitter`. The underlying implementation will look something like this: ```swift public func sendUnary(_ request: Request, body: Data?, trailers: [String: [String]] = [:], handler: ResponseHandler) { let emitter = self.startStream(with: request, handler: handler) if let body = body { emitter.sendData(body) } emitter.close(trailers: trailers) } ``` Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
- Loading branch information
Showing
5 changed files
with
21 additions
and
125 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
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
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