zio-grpc
zio-grpc copied to clipboard
Backpressure support
Use gRPC built-in flow control to support backpressure.
Hello again! I've just added:
- tests for all backpressure scenarios
- protect
sendMessageWhenReady
with Semaphore (because concurrent access can override other fiber promise) - another
isReady
check before sending a message (according to gRPC doc) - small typo fix in another test
Thanks for working on this. This looks really good. My main concern would be the need to support it (due to the subtleties and potential race conditions) so I'm looking for a way to better contain the change. Another, secondary concern, is potential impact on throughput.
@thesamet thanks for the quick reply!
To keep both implementations of the calls I've splitted ZCall
into two traits: ZCall
and ZCallBase
. Now it is possible to change parent trait for ZCallBase
to switch it behaviour (with or without backpressure).
I've also mark BackpressureTestServiceSpec
as ignored
to keep tests passing for now.
Would love to zio-grpc gain see back pressure support. Any blockers to getting this PR merged?
Hey @fillson-shady / @thesamet , was this abandoned? I was surprised to find out that zio-grpc is not back pressure aware.
I am hesitant on getting this merged due to the additional complexity to support and maintain this. Given that grpc-java doesn't provide this, I think that the need for backpressure support is limited or can be handled at the application layer.