Class SynchronizedRequestStream<T>

  • Type Parameters:
    T - the type of value returned by this stream
    All Implemented Interfaces:
    io.grpc.stub.StreamObserver<T>

    public class SynchronizedRequestStream<T>
    extends io.grpc.stub.ClientCallStreamObserver<T>
    Lock-based synchronized implementation of a ClientCallStreamObserver. Acts as a wrapper of another ClientCallStreamObserver, to which all of operations will be delegated, adding synchronization logic to onNext(Object), onCompleted() and onError(Throwable).
    • Constructor Detail

      • SynchronizedRequestStream

        public SynchronizedRequestStream​(io.grpc.stub.ClientCallStreamObserver<T> requestStream)
        Instantiate a SynchronizedRequestStream, delegating all operations to the given requestStream
        Parameters:
        requestStream - the ClientCallStreamObserver to delegate method invocations to
    • Method Detail

      • cancel

        public void cancel​(String message,
                           Throwable cause)
        Specified by:
        cancel in class io.grpc.stub.ClientCallStreamObserver<T>
      • isReady

        public boolean isReady()
        Specified by:
        isReady in class io.grpc.stub.ClientCallStreamObserver<T>
      • setOnReadyHandler

        public void setOnReadyHandler​(Runnable onReadyHandler)
        Specified by:
        setOnReadyHandler in class io.grpc.stub.ClientCallStreamObserver<T>
      • disableAutoInboundFlowControl

        public void disableAutoInboundFlowControl()
        Specified by:
        disableAutoInboundFlowControl in class io.grpc.stub.CallStreamObserver<T>
      • request

        public void request​(int count)
        Specified by:
        request in class io.grpc.stub.ClientCallStreamObserver<T>
      • setMessageCompression

        public void setMessageCompression​(boolean enable)
        Specified by:
        setMessageCompression in class io.grpc.stub.ClientCallStreamObserver<T>
      • onNext

        public void onNext​(T value)
      • disableAutoRequestWithInitial

        public void disableAutoRequestWithInitial​(int request)
        Overrides:
        disableAutoRequestWithInitial in class io.grpc.stub.ClientCallStreamObserver<T>
      • onError

        public void onError​(Throwable t)
      • onCompleted

        public void onCompleted()