Class ObservableReactiveUtil
java.lang.Object
com.google.cloud.spring.data.firestore.util.ObservableReactiveUtil
Converter from a gRPC async calls to Reactor primitives (
Mono, Flux).- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R> reactor.core.publisher.Flux<R>streamingCall(Consumer<io.grpc.stub.StreamObserver<R>> remoteCall) Invokes a lambda that issues a streaming call and directs the response to aFluxstream.static <R> reactor.core.publisher.Mono<R>Invokes a lambda that in turn issues a remote call, directing the response to aMonostream.
-
Method Details
-
unaryCall
public static <R> reactor.core.publisher.Mono<R> unaryCall(Consumer<io.grpc.stub.StreamObserver<R>> remoteCall) Invokes a lambda that in turn issues a remote call, directing the response to aMonostream.- Type Parameters:
R- type of remote call response- Parameters:
remoteCall- lambda capable of invoking the correct remote call, making use of theMono-convertingStreamObserverimplementation.- Returns:
Monocontaining the response of the unary call.
-
streamingCall
public static <R> reactor.core.publisher.Flux<R> streamingCall(Consumer<io.grpc.stub.StreamObserver<R>> remoteCall) Invokes a lambda that issues a streaming call and directs the response to aFluxstream.- Type Parameters:
R- response type- Parameters:
remoteCall- call to make- Returns:
Fluxof response objects resulting from the streaming call.
-