Package io.grpc.stub
Interface ClientResponseObserver<ReqT,RespT>
- All Superinterfaces:
StreamObserver<RespT>
Specialization of
StreamObserver
implemented by clients in order to interact with the
advanced features of a call such as flow-control.-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeStart
(ClientCallStreamObserver<ReqT> requestStream) Called by the runtime prior to the start of a call to provide a reference to theClientCallStreamObserver
for the outbound stream.Methods inherited from interface io.grpc.stub.StreamObserver
onCompleted, onError, onNext
-
Method Details
-
beforeStart
Called by the runtime prior to the start of a call to provide a reference to theClientCallStreamObserver
for the outbound stream. This can be used to listen to onReady events, disable auto inbound flow and perform other advanced functions.Only the methods
ClientCallStreamObserver.setOnReadyHandler(Runnable)
andClientCallStreamObserver.disableAutoRequestWithInitial(int)
may be called within this callback// Copy an iterator to the request stream under flow-control someStub.fullDuplexCall(new ClientResponseObserver<ReqT, RespT>() { public void beforeStart(final ClientCallStreamObserver<Req> requestStream) { StreamObservers.copyWithFlowControl(someIterator, requestStream); });
-