Package org.apache.beam.sdk.fn.stream
Class DirectStreamObserver<T>
java.lang.Object
org.apache.beam.sdk.fn.stream.DirectStreamObserver<T>
- All Implemented Interfaces:
org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<T>
@ThreadSafe
public final class DirectStreamObserver<T>
extends Object
implements org.apache.beam.vendor.grpc.v1p69p0.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. If the Phaser
is terminated,
}
will no longer wait for the invalid @link
{@link DirectStreamObserver<T>.onNext(T)
CallStreamObserver
to become ready.
-
Constructor Summary
ConstructorsConstructorDescriptionDirectStreamObserver
(Phaser phaser, org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.CallStreamObserver<T> outboundObserver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
-
Constructor Details
-
DirectStreamObserver
-
-
Method Details
-
onNext
- Specified by:
onNext
in interfaceorg.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<T>
-
onError
- Specified by:
onError
in interfaceorg.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<T>
-
onCompleted
public void onCompleted()- Specified by:
onCompleted
in interfaceorg.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<T>
-