Package io.grpc.stub
Class ClientCallStreamObserver<V>
- java.lang.Object
-
- io.grpc.stub.CallStreamObserver<V>
-
- io.grpc.stub.ClientCallStreamObserver<V>
-
- All Implemented Interfaces:
StreamObserver<V>
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1788") public abstract class ClientCallStreamObserver<V> extends CallStreamObserver<V>
A refinement ofCallStreamObserverthat allows for lower-level interaction with client calls.Like
StreamObserver, implementations are not required to be thread-safe; if multiple threads will be writing to an instance concurrently, the application must synchronize its calls.DO NOT MOCK: The API is too complex to reliably mock. Use InProcessChannelBuilder to create "real" RPCs suitable for testing and make a fake for the server-side.
-
-
Constructor Summary
Constructors Constructor Description ClientCallStreamObserver()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidcancel(java.lang.String message, java.lang.Throwable cause)Prevent any further processing for thisClientCallStreamObserver.-
Methods inherited from class io.grpc.stub.CallStreamObserver
disableAutoInboundFlowControl, isReady, request, setMessageCompression, setOnReadyHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.grpc.stub.StreamObserver
onCompleted, onError, onNext
-
-
-
-
Method Detail
-
cancel
public abstract void cancel(@Nullable java.lang.String message, @Nullable java.lang.Throwable cause)Prevent any further processing for thisClientCallStreamObserver. No further messages will be received. The server is informed of cancellations, but may not stop processing the call. Cancelling an alreadycancel()edClientCallStreamObserverhas no effect.No other methods on this class can be called after this method has been called.
It is recommended that at least one of the arguments to be non-
null, to provide useful debug information. Both argument being null may log warnings and result in suboptimal performance. Also note that the provided information will not be sent to the server.- Parameters:
message- if notnull, will appear as the description of the CANCELLED statuscause- if notnull, will appear as the cause of the CANCELLED status
-
-