This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
feat: introduce HttpJsonClientCall, Listeners infrastructure and ServerStreaming support in REST transport #1599
Merged
Commits on Jan 12, 2022
-
feat: Introduce HttpJsonClientCall, Listeners infrastructure and Serv…
…erStreaming support in REST transport This includes the following changes for HTTP1.1/REST transport: 1) `HttpJsonClientCall` class (with `HttpJsonClientCall.Listener`) mimicking [io.grpc.ClientCall](https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/ClientCall.java#L102) functionality. 2) The unary callables are rewritten to be based on `HttpJsonClientCall` flow (similarly to how it is already done in grpc unary calls). 3) Server streaming support for REST transport. The implementation is based on `HttpJsonClientCall` and `HttpJsonClientCall.Listener`, similarly to how grpc streaming is based on `io.grpc.ClientCall` and io.grpc.ClientCall.Listener` respectively. The extreme similarity between `HttpJsonClient` call and `io.grpc.ClientCall` is intentional and crucial for consistency of the two transports and also intends simplifying creation and maintenance of multi-transport manual wrappers (like [google-ads](https://github.com/googleads/google-ads-java/blob/main/google-ads/src/main/java/com/google/ads/googleads/lib/logging/LoggingInterceptor.java#L68)). The server streaming abstractions in gax java are all based on the flow control managed by a ClientCall, so having similar set of abstractions in REST transport is necessary to reuse transport-independent portions of streaming logic in gax and maintain identical user-facing streaming surface. This PR also builds a foundation for the soon-coming [ClientInterceptor](https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/ClientInterceptor.java#L42)-like infrastructure in REST transport. REST-based client-side streaming and bidirectional streaming is not implemented by this PR and most likely will never be due to limitations of the HTTP1.1/REST protocol compared to HTTP2/gRPC. Note, ideally I need to split this PR at least in two separate ones: 1) HttpJsonClientCall stuff and unary calls based on it in one PR and then 2) server streaming feature in a second PR. Unfortunately only reasonable way to test `HttpJsonClientCall` infrastructure is by doing it from server streaming logic beause most of the complexity introduced in HttpJsonClient call is induced by necessity to support streaming workflow.
Configuration menu - View commit details
-
Copy full SHA for c382b4a - Browse repository at this point
Copy the full SHA c382b4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c86cf8b - Browse repository at this point
Copy the full SHA c86cf8bView commit details
Commits on Jan 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d0faae4 - Browse repository at this point
Copy the full SHA d0faae4View commit details
Commits on Jan 16, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 27748aa - Browse repository at this point
Copy the full SHA 27748aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e2da06 - Browse repository at this point
Copy the full SHA 2e2da06View commit details
Commits on Jan 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 0f7edc8 - Browse repository at this point
Copy the full SHA 0f7edc8View commit details
Commits on Jan 21, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 912e504 - Browse repository at this point
Copy the full SHA 912e504View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad57564 - Browse repository at this point
Copy the full SHA ad57564View commit details
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.