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 aFlux
stream.static <R> reactor.core.publisher.Mono<R>
Invokes a lambda that in turn issues a remote call, directing the response to aMono
stream.
-
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 aMono
stream.- Type Parameters:
R
- type of remote call response- Parameters:
remoteCall
- lambda capable of invoking the correct remote call, making use of theMono
-convertingStreamObserver
implementation.- Returns:
Mono
containing 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 aFlux
stream.- Type Parameters:
R
- response type- Parameters:
remoteCall
- call to make- Returns:
Flux
of response objects resulting from the streaming call.
-