-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming gRPC client has no backpressure #631
Comments
A PR that adds backpressure (disabled by default) will be accepted.
Generally, porting an implementation should be ok. If unsure please check
directly with fs2-grpc team.
…On Tue, May 28, 2024, 2:12 AM Georgi Krastev ***@***.***> wrote:
It uses an unbounded queue:
https://github.com/scalapb/zio-grpc/blob/def8d5d99b51330627d7b0b4f84b887de5b03034/core/src/main/scalajvm/scalapb/zio_grpc/client/StreamingClientCallListener.scala#L51
But there is no external backpressure mechanism, we request the next
message as soon as we receive one:
https://github.com/scalapb/zio-grpc/blob/def8d5d99b51330627d7b0b4f84b887de5b03034/core/src/main/scalajvm/scalapb/zio_grpc/client/StreamingClientCallListener.scala#L27
In addition, to use a (configurable) batch size > 1 when requesting
messages from the server.
If that's ok in terms of IP, I can port the solution from fs2-grpc to
zio-grpc.
—
Reply to this email directly, view it on GitHub
<#631>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACLBLJWVBHD6CIDF6VYNILZERDBDAVCNFSM6AAAAABIMQB7KCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDANJUGA4DGMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Where can we configure it? I can't find a good place. |
See zio-grpc/core/src/main/scalajvm/scalapb/zio_grpc/server/ZServerCallHandler.scala Lines 41 to 48 in def8d5d
|
I added it as a parameter to |
Can you rephrase your question, I am not sure exactly what are you looking for. |
In my PR I just added a constructor parameter to |
Or do you mean that I should reuse |
Since it's a constructor parameter, no need to introduce a property. |
It uses an unbounded queue:
zio-grpc/core/src/main/scalajvm/scalapb/zio_grpc/client/StreamingClientCallListener.scala
Line 51 in def8d5d
But there is no external backpressure mechanism, we request the next message as soon as we receive one:
zio-grpc/core/src/main/scalajvm/scalapb/zio_grpc/client/StreamingClientCallListener.scala
Line 27 in def8d5d
In addition, it would be beneficial to use a (configurable) batch size > 1 when requesting messages from the server.
If that's ok in terms of IP, I can port the solution from fs2-grpc to zio-grpc.
The text was updated successfully, but these errors were encountered: