java.lang.Object
io.helidon.grpc.core.LambdaStreamObserver<V>
- Type Parameters:
V
- the type of elements being observed
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<V>
A
StreamObserver
that uses lambdas to handle the
various messages.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> io.grpc.stub.StreamObserver<T>
Create aStreamObserver
that passes values received by itsStreamObserver.onNext(Object)
method to aConsumer
.static <T> io.grpc.stub.StreamObserver<T>
Create aStreamObserver
that uses the specified lambda to handle events.void
void
void
-
Method Details
-
onNext
- Specified by:
onNext
in interfaceio.grpc.stub.StreamObserver<V>
-
onError
- Specified by:
onError
in interfaceio.grpc.stub.StreamObserver<V>
-
onCompleted
public void onCompleted()- Specified by:
onCompleted
in interfaceio.grpc.stub.StreamObserver<V>
-
create
Create aStreamObserver
that passes values received by itsStreamObserver.onNext(Object)
method to aConsumer
.- Type Parameters:
T
- the type of value to receive- Parameters:
onNext
- theConsumer
to receive the values- Returns:
- a
StreamObserver
-
create
public static <T> io.grpc.stub.StreamObserver<T> create(Consumer<T> onNext, Runnable onComplete, Consumer<Throwable> onError) Create aStreamObserver
that uses the specified lambda to handle events.
-