This repository was archived by the owner on Sep 26, 2023. It is now read-only.
back pressure: ResponseObserver & StreamController#437
Merged
garrettjonesgoogle merged 11 commits intogoogleapis:masterfrom Dec 6, 2017
Merged
back pressure: ResponseObserver & StreamController#437garrettjonesgoogle merged 11 commits intogoogleapis:masterfrom
garrettjonesgoogle merged 11 commits intogoogleapis:masterfrom
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Introduces back pressure to gax's ServerStreamingCallables. This is part of #433
ApiStreamObserver gets upgraded to a ResponseObserver, which on stream start receives a StreamController. The StreamController allows the ResponseObserver to manually control flow. This inspired by reactive streams's api and grpc's ClientResponseObserver#beforeStart api:
https://github.com/grpc/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/ClientResponseObserver.java#L44
This api enables interoperability with other frameworks like RxJava & Akka and more importantly, allows for iterator style streams to be implemented on top of gax. This will, in turn, allow us to compose ServerStreamingCallables via call(Request, ResponseObserver, Context) chaining.
The external api is backwards compatible, but will break subclasses of ServerStreamCallable
Next PRs: