Class ObservableReactiveUtil

java.lang.Object
com.google.cloud.spring.data.firestore.util.ObservableReactiveUtil

public final class ObservableReactiveUtil extends Object
Converter from a gRPC async calls to Reactor primitives (Mono, Flux).
Since:
1.2
  • Method Summary

    Modifier and Type
    Method
    Description
    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 a Flux stream.
    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 a Mono stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a Mono stream.
      Type Parameters:
      R - type of remote call response
      Parameters:
      remoteCall - lambda capable of invoking the correct remote call, making use of the Mono-converting StreamObserver 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 a Flux stream.
      Type Parameters:
      R - response type
      Parameters:
      remoteCall - call to make
      Returns:
      Flux of response objects resulting from the streaming call.