-
public interface AsyncHelpers
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> java.util.concurrent.CompletionStage<T>
applyExceptionally(java.util.concurrent.CompletionStage<T> upstream, java.util.function.Function<java.lang.Throwable,java.lang.Throwable> mapper)
Applies a function on failure to produce another failure.static <T> java.util.concurrent.CompletionStage<T>
composeExceptionally(java.util.concurrent.CompletionStage<T> upstream, java.util.function.Function<java.lang.Throwable,java.util.concurrent.CompletionStage<T>> mapper)
Composes the given completion stage on failure.
-
-
-
Method Detail
-
applyExceptionally
static <T> java.util.concurrent.CompletionStage<T> applyExceptionally(java.util.concurrent.CompletionStage<T> upstream, java.util.function.Function<java.lang.Throwable,java.lang.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> java.util.concurrent.CompletionStage<T> composeExceptionally(java.util.concurrent.CompletionStage<T> upstream, java.util.function.Function<java.lang.Throwable,java.util.concurrent.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.
-
-