Class RxUtils

java.lang.Object
org.neo4j.driver.internal.reactive.RxUtils

public class RxUtils extends Object
  • Constructor Details

    • RxUtils

      public RxUtils()
  • Method Details

    • createEmptyPublisher

      public static <T> org.reactivestreams.Publisher<T> createEmptyPublisher(Supplier<CompletionStage<Void>> supplier)
      The publisher created by this method will either succeed without publishing anything or fail with an error.
      Parameters:
      supplier - supplies a CompletionStage<Void>.
      Returns:
      A publisher that publishes nothing on completion or fails with an error.
    • createSingleItemPublisher

      public static <T> reactor.core.publisher.Mono<T> createSingleItemPublisher(Supplier<CompletionStage<T>> supplier, Supplier<Throwable> nullResultThrowableSupplier, Consumer<T> cancellationHandler)
      The publisher created by this method will either succeed with exactly one item or fail with an error.
      Type Parameters:
      T - the type of the item to publish.
      Parameters:
      supplier - supplies a CompletionStage<T> that MUST produce a non-null result when completed successfully.
      nullResultThrowableSupplier - supplies a Throwable that is used as an error when the supplied completion stage completes successfully with null.
      cancellationHandler - handles cancellation, may be used to release associated resources
      Returns:
      A publisher that succeeds exactly one item or fails with an error.