Package io.grpc.stub
Interface ClientResponseObserver<ReqT,RespT>
-
- All Superinterfaces:
StreamObserver<RespT>
public interface ClientResponseObserver<ReqT,RespT> extends StreamObserver<RespT>
Specialization ofStreamObserver
implemented by clients in order to interact with the advanced features of a call such as flow-control.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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 Detail
-
beforeStart
void 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. 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); });
-
-