Take a look at https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/manualflowcontrol and disableAutoRequest() for manual flow control.
I think it is okay to block on onNext() call for automatic flow control. Check this https://grpc.github.io/grpc-java/javadoc/io/grpc/stub/CallStreamObserver.html#disableAutoInboundFlowControl-- which says "automatic flow control where a token is returned to the peer after a call to the 'inbound' StreamObserver.onNext(Object) <https://grpc.github.io/grpc-java/javadoc/io/grpc/stub/StreamObserver.html#onNext-V-> has completed." On Friday, December 16, 2022 at 4:23:58 PM UTC-8 liuya...@gmail.com wrote: > Hi, > > I am trying to use bidi streaming RPC for multiple large chunks of data. > > I was wondering how to flow control is done for bidi streaming java. > > If I want to apply backpressure from server side, can I just block on > onNext() call? My understanding is this should be a grpc executor task I > shouldn't block. > > Does this mean I have to do the manual control flow to apply back pressure > and there is no default option? > > Thanks! > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/dd064098-69e8-4d78-96c8-8e77b28739e6n%40googlegroups.com.