java.lang.Object
org.neo4j.driver.internal.reactive.RxUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.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.
-
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 aCompletionStage<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 aCompletionStage<T>
that MUST produce a non-null result when completed successfully.nullResultThrowableSupplier
- supplies aThrowable
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.
-