Package io.helidon.grpc.core
Class LambdaStreamObserver<V>
- 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>
public class LambdaStreamObserver<V> extends Object implements io.grpc.stub.StreamObserver<V>
AStreamObserver
that uses lambdas to handle the various messages.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> io.grpc.stub.StreamObserver<T>
create(Consumer<T> onNext)
Create aStreamObserver
that passes values received by itsStreamObserver.onNext(Object)
method to aConsumer
.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.void
onCompleted()
void
onError(Throwable error)
void
onNext(V value)
-
-
-
Method Detail
-
onNext
public void onNext(V value)
- Specified by:
onNext
in interfaceio.grpc.stub.StreamObserver<V>
-
onError
public void onError(Throwable error)
- Specified by:
onError
in interfaceio.grpc.stub.StreamObserver<V>
-
onCompleted
public void onCompleted()
- Specified by:
onCompleted
in interfaceio.grpc.stub.StreamObserver<V>
-
create
public static <T> io.grpc.stub.StreamObserver<T> create(Consumer<T> onNext)
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
-
-