Package org.infinispan.reactive
Class RxJavaInterop
java.lang.Object
org.infinispan.commons.reactive.RxJavaInterop
org.infinispan.reactive.RxJavaInterop
Static factory class that provides methods to obtain commonly used instances for interoperation between RxJava
and standard JRE.
- Since:
- 10.0
- Author:
- wburns
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <I> BiFunction
<I, I, io.reactivex.rxjava3.core.Flowable<I>> Provides aBiFunction
to be used with methods likeCompletionStage.thenCombine(CompletionStage, java.util.function.BiFunction)
to convert the values to aFlowable
.static <R> io.reactivex.rxjava3.core.Flowable
<R> voidCompletionStageToFlowable
(CompletionStage<?> stage) static <R> io.reactivex.rxjava3.core.Flowable
<R> voidCompletionStageToFlowable
(CompletionStage<Void> stage, boolean ignoreErrorIfCancelled) Same asvoidCompletionStageToFlowable(CompletionStage)
except that you can optionally have it so that if a throwable occurs in the stage that it isn't propagated if the returned Flowable's subscription was cancelled.Methods inherited from class org.infinispan.commons.reactive.RxJavaInterop
cacheExceptionWrapper, completedFlowableProcessor, emptyConsumer, entryToKeyFunction, entryToValueFunction, identityFunction
-
Field Details
-
log
protected static final org.infinispan.util.logging.Log log
-
-
Method Details
-
voidCompletionStageToFlowable
public static <R> io.reactivex.rxjava3.core.Flowable<R> voidCompletionStageToFlowable(CompletionStage<?> stage) -
voidCompletionStageToFlowable
public static <R> io.reactivex.rxjava3.core.Flowable<R> voidCompletionStageToFlowable(CompletionStage<Void> stage, boolean ignoreErrorIfCancelled) Same asvoidCompletionStageToFlowable(CompletionStage)
except that you can optionally have it so that if a throwable occurs in the stage that it isn't propagated if the returned Flowable's subscription was cancelled.This method also only allows for a single subscriber to the Flowable, any additional subscribers will receive an exception when subscribing to the returned Flowable.
voidCompletionStageToFlowable(CompletionStage)
can support any number of subscribers.- Type Parameters:
R
- stage type- Parameters:
stage
- stage to completeignoreErrorIfCancelled
- whether to ignore an error if cancelled- Returns:
- a Flowable that is completed when the stage is
-
combinedBiFunction
Provides aBiFunction
to be used with methods likeCompletionStage.thenCombine(CompletionStage, java.util.function.BiFunction)
to convert the values to aFlowable
. Note this is useful as Flowable does not allow null values and this function will handle this properly by not publishing a value if it is null. So it is possible to have an empty Flowable returned.- Type Parameters:
I
- user value type- Returns:
- a function to be used to combine the possible values as a returned Flowable
-