public interface AsyncHelpers
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> CompletionStage<T>
applyExceptionally
(CompletionStage<T> upstream, Function<Throwable, Throwable> mapper) Applies a function on failure to produce another failure.static <T> CompletionStage<T>
composeExceptionally
(CompletionStage<T> upstream, Function<Throwable, CompletionStage<T>> mapper) Composes the given completion stage on failure.
-
Method Details
-
applyExceptionally
static <T> CompletionStage<T> applyExceptionally(CompletionStage<T> upstream, Function<Throwable, Throwable> mapper) Applies a function on failure to produce another failure.- Type Parameters:
T
- the type of emitted item- Parameters:
upstream
- the upstream stage.mapper
- the mapper- Returns:
- the mapped completion stage.
-
composeExceptionally
static <T> CompletionStage<T> composeExceptionally(CompletionStage<T> upstream, Function<Throwable, CompletionStage<T>> mapper) Composes the given completion stage on failure.- Type Parameters:
T
- the type of emitted item- Parameters:
upstream
- the upstream stagemapper
- the mapper- Returns:
- the composed completion stage.
-