java.lang.Object
io.helidon.common.reactive.CompletionAwaitable<T>
- Type Parameters:
T
- payload type
- All Implemented Interfaces:
Awaitable<T>
,CompletionStage<T>
- Direct Known Subclasses:
CompletionSingle
CompletionStage
wrapper enriched with Awaitable
.-
Method Summary
Modifier and TypeMethodDescriptionacceptEither
(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync
(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync
(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) <U> CompletionAwaitable
<U> applyToEither
(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CompletionAwaitable
<U> applyToEitherAsync
(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CompletionAwaitable
<U> applyToEitherAsync
(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) exceptionally
(Function<Throwable, ? extends T> fn) exceptionallyAccept
(Consumer<Throwable> consumer) Returns a new CompletionAwaitable that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied consumer.<U> CompletionAwaitable
<U> handle
(BiFunction<? super T, Throwable, ? extends U> fn) <U> CompletionAwaitable
<U> handleAsync
(BiFunction<? super T, Throwable, ? extends U> fn) <U> CompletionAwaitable
<U> handleAsync
(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) runAfterBoth
(CompletionStage<?> other, Runnable action) runAfterBothAsync
(CompletionStage<?> other, Runnable action) runAfterBothAsync
(CompletionStage<?> other, Runnable action, Executor executor) runAfterEither
(CompletionStage<?> other, Runnable action) runAfterEitherAsync
(CompletionStage<?> other, Runnable action) runAfterEitherAsync
(CompletionStage<?> other, Runnable action, Executor executor) thenAccept
(Consumer<? super T> action) thenAcceptAsync
(Consumer<? super T> action) thenAcceptAsync
(Consumer<? super T> action, Executor executor) <U> CompletionAwaitable
<Void> thenAcceptBoth
(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CompletionAwaitable
<Void> thenAcceptBothAsync
(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CompletionAwaitable
<Void> thenAcceptBothAsync
(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) <U> CompletionAwaitable
<U> <U> CompletionAwaitable
<U> thenApplyAsync
(Function<? super T, ? extends U> fn) <U> CompletionAwaitable
<U> thenApplyAsync
(Function<? super T, ? extends U> fn, Executor executor) <U,
V> CompletionAwaitable <V> thenCombine
(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,
V> CompletionAwaitable <V> thenCombineAsync
(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,
V> CompletionAwaitable <V> thenCombineAsync
(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) <U> CompletionAwaitable
<U> thenCompose
(Function<? super T, ? extends CompletionStage<U>> fn) <U> CompletionAwaitable
<U> thenComposeAsync
(Function<? super T, ? extends CompletionStage<U>> fn) <U> CompletionAwaitable
<U> thenComposeAsync
(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) thenRunAsync
(Runnable action) thenRunAsync
(Runnable action, Executor executor) Returns aCompletableFuture
maintaining the same completion properties as this stage.whenComplete
(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync
(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync
(BiConsumer<? super T, ? super Throwable> action, Executor executor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.CompletionStage
exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync
-
Method Details
-
thenApply
- Specified by:
thenApply
in interfaceCompletionStage<T>
-
thenApplyAsync
- Specified by:
thenApplyAsync
in interfaceCompletionStage<T>
-
thenApplyAsync
public <U> CompletionAwaitable<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) - Specified by:
thenApplyAsync
in interfaceCompletionStage<T>
-
thenAccept
- Specified by:
thenAccept
in interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsync
in interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsync
in interfaceCompletionStage<T>
-
thenRun
- Specified by:
thenRun
in interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsync
in interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsync
in interfaceCompletionStage<T>
-
thenCombine
public <U,V> CompletionAwaitable<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombine
in interfaceCompletionStage<T>
-
thenCombineAsync
public <U,V> CompletionAwaitable<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombineAsync
in interfaceCompletionStage<T>
-
thenCombineAsync
public <U,V> CompletionAwaitable<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) - Specified by:
thenCombineAsync
in interfaceCompletionStage<T>
-
thenAcceptBoth
public <U> CompletionAwaitable<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBoth
in interfaceCompletionStage<T>
-
thenAcceptBothAsync
public <U> CompletionAwaitable<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothAsync
in interfaceCompletionStage<T>
-
thenAcceptBothAsync
public <U> CompletionAwaitable<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) - Specified by:
thenAcceptBothAsync
in interfaceCompletionStage<T>
-
runAfterBoth
- Specified by:
runAfterBoth
in interfaceCompletionStage<T>
-
runAfterBothAsync
- Specified by:
runAfterBothAsync
in interfaceCompletionStage<T>
-
runAfterBothAsync
public CompletionAwaitable<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterBothAsync
in interfaceCompletionStage<T>
-
applyToEither
public <U> CompletionAwaitable<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEither
in interfaceCompletionStage<T>
-
applyToEitherAsync
public <U> CompletionAwaitable<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherAsync
in interfaceCompletionStage<T>
-
applyToEitherAsync
public <U> CompletionAwaitable<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) - Specified by:
applyToEitherAsync
in interfaceCompletionStage<T>
-
acceptEither
public CompletionAwaitable<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEither
in interfaceCompletionStage<T>
-
acceptEitherAsync
public CompletionAwaitable<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherAsync
in interfaceCompletionStage<T>
-
acceptEitherAsync
public CompletionAwaitable<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) - Specified by:
acceptEitherAsync
in interfaceCompletionStage<T>
-
runAfterEither
- Specified by:
runAfterEither
in interfaceCompletionStage<T>
-
runAfterEitherAsync
- Specified by:
runAfterEitherAsync
in interfaceCompletionStage<T>
-
runAfterEitherAsync
public CompletionAwaitable<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterEitherAsync
in interfaceCompletionStage<T>
-
thenCompose
- Specified by:
thenCompose
in interfaceCompletionStage<T>
-
thenComposeAsync
public <U> CompletionAwaitable<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) - Specified by:
thenComposeAsync
in interfaceCompletionStage<T>
-
thenComposeAsync
public <U> CompletionAwaitable<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) - Specified by:
thenComposeAsync
in interfaceCompletionStage<T>
-
handle
- Specified by:
handle
in interfaceCompletionStage<T>
-
handleAsync
- Specified by:
handleAsync
in interfaceCompletionStage<T>
-
handleAsync
public <U> CompletionAwaitable<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) - Specified by:
handleAsync
in interfaceCompletionStage<T>
-
whenComplete
- Specified by:
whenComplete
in interfaceCompletionStage<T>
-
whenCompleteAsync
- Specified by:
whenCompleteAsync
in interfaceCompletionStage<T>
-
whenCompleteAsync
public CompletionAwaitable<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) - Specified by:
whenCompleteAsync
in interfaceCompletionStage<T>
-
exceptionally
- Specified by:
exceptionally
in interfaceCompletionStage<T>
-
exceptionallyAccept
Returns a new CompletionAwaitable that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied consumer. Otherwise, if this stage completes normally, then the returned stage also completes normally with the same value.- Parameters:
consumer
- the consumer to invoke if this CompletionAwaitable completed exceptionally- Returns:
- the new CompletionAwaitable
-
toCompletableFuture
Description copied from interface:Awaitable
Returns aCompletableFuture
maintaining the same completion properties as this stage. If this stage is already a CompletableFuture, this method may return this stage itself. Otherwise, invocation of this method may be equivalent in effect tothenApply(x -> x)
, but returning an instance of typeCompletableFuture
.- Specified by:
toCompletableFuture
in interfaceAwaitable<T>
- Specified by:
toCompletableFuture
in interfaceCompletionStage<T>
- Returns:
- the CompletableFuture
-