public interface ClientResponseObserver<ReqT,RespT> extends StreamObserver<RespT>
StreamObserver
implemented by clients in order to interact with the
advanced features of a call such as flow-control.Modifier and Type | Method and Description |
---|---|
void |
beforeStart(ClientCallStreamObserver<ReqT> requestStream)
Called by the runtime priot to the start of a call to provide a reference to the
ClientCallStreamObserver for the outbound stream. |
onCompleted, onError, onNext
void beforeStart(ClientCallStreamObserver<ReqT> requestStream)
ClientCallStreamObserver
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)
and
ClientCallStreamObserver.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); });