scalapb / zio-grpc

ScalaPB meets ZIO: write purely functional gRPC services and clients using ZIO
Apache License 2.0
257 stars 81 forks source link

Implement streaming client backpressure with configurable batch size #636

Open joroKr21 opened 1 month ago

joroKr21 commented 1 month ago

Closes #631

joroKr21 commented 3 weeks ago

can you add tests for the new functionality?

I don't quite understand the testing machinery here. How can we test backpressure?

joroKr21 commented 3 weeks ago

@thesamet it's not possible to test backpressure reliably because the server just keeps sending messages. See: https://github.com/scalapb/zio-grpc/blob/5d29b6e0e55800c59ed6c48d16d5a07da96b840c/core/src/main/scalajvm/scalapb/zio_grpc/server/ZServerCallHandler.scala#L115

The check to call.call.isReady succeeds and is not related to call.awaitReady:

I don't know if that's intended or not but it means that test service keeps sending me messages I didn't request in the client.