java.lang.Object
io.helidon.grpc.core.CollectingObserver<T,V,U,A,R>
- Type Parameters:
T
- the type of input elements to the reduction operationV
- the request type before conversionU
- the type of values observedA
- the mutable accumulation type of the reduction operationR
- the result type of the reduction operation
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<V>
Utility
StreamObserver
mostly used for testing.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
V, U, A, R>
CollectingObserver<T, V, U, A, R> Creates collecting observer from a collector and another observer.static <T,
V, U, A, R>
CollectingObserver<T, V, U, A, R> create
(Collector<T, A, R> collector, io.grpc.stub.StreamObserver<U> observer, Consumer<Throwable> errorHandler) Creates collecting observer from a collector, another observer and an error handler.static <T,
V, U, A, R>
CollectingObserver<T, V, U, A, R> create
(Collector<T, A, R> collector, io.grpc.stub.StreamObserver<U> observer, Function<V, T> requestConverter, Function<R, U> responseConverter) Creates collecting observer from a collector, another observer and converters.void
void
void
-
Method Details
-
create
public static <T,V, CollectingObserver<T,U, A, R> V, createU, A, R> (Collector<T, A, R> collector, io.grpc.stub.StreamObserver<U> observer) Creates collecting observer from a collector and another observer.- Type Parameters:
T
- the type of input elements to the reduction operationV
- the request type before conversionU
- the type of values observedA
- the mutable accumulation type of the reduction operationR
- the result type of the reduction operation- Parameters:
collector
- the collectorobserver
- the observer- Returns:
- new collecting observer
-
create
public static <T,V, CollectingObserver<T,U, A, R> V, createU, A, R> (Collector<T, A, R> collector, io.grpc.stub.StreamObserver<U> observer, Consumer<Throwable> errorHandler) Creates collecting observer from a collector, another observer and an error handler.- Type Parameters:
T
- the type of input elements to the reduction operationV
- the request type before conversionU
- the type of values observedA
- the mutable accumulation type of the reduction operationR
- the result type of the reduction operation- Parameters:
collector
- the collectorobserver
- the observererrorHandler
- the error handler- Returns:
- new collecting observer
-
create
public static <T,V, CollectingObserver<T,U, A, R> V, createU, A, R> (Collector<T, A, R> collector, io.grpc.stub.StreamObserver<U> observer, Function<V, T> requestConverter, Function<R, U> responseConverter) Creates collecting observer from a collector, another observer and converters.- Type Parameters:
T
- the type of input elements to the reduction operationV
- the request type before conversionU
- the type of values observedA
- the mutable accumulation type of the reduction operationR
- the result type of the reduction operation- Parameters:
collector
- the collectorobserver
- the observerrequestConverter
- request converterresponseConverter
- response converter- Returns:
- new collecting observer
-
onNext
- Specified by:
onNext
in interfaceio.grpc.stub.StreamObserver<T>
-
onError
- Specified by:
onError
in interfaceio.grpc.stub.StreamObserver<T>
-
onCompleted
public void onCompleted()- Specified by:
onCompleted
in interfaceio.grpc.stub.StreamObserver<T>
-