Class DirectStreamObserver<T>

  • All Implemented Interfaces:
    org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<T>

    @ThreadSafe
    public final class DirectStreamObserver<T>
    extends java.lang.Object
    implements org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<T>
    A StreamObserver which uses synchronization on the underlying CallStreamObserver to provide thread safety.

    Flow control with the underlying CallStreamObserver is handled with a Phaser which waits for advancement of the phase if the CallStreamObserver is not ready. Creator is expected to advance the Phaser whenever the underlying CallStreamObserver becomes ready.

    • Constructor Summary

      Constructors 
      Constructor Description
      DirectStreamObserver​(java.util.concurrent.Phaser phaser, org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.CallStreamObserver<T> outboundObserver)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onCompleted()  
      void onError​(java.lang.Throwable t)  
      void onNext​(T value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectStreamObserver

        public DirectStreamObserver​(java.util.concurrent.Phaser phaser,
                                    org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.CallStreamObserver<T> outboundObserver)
    • Method Detail

      • onNext

        public void onNext​(T value)
        Specified by:
        onNext in interface org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<T>
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<T>
      • onCompleted

        public void onCompleted()
        Specified by:
        onCompleted in interface org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<T>