Interface ReactionStage<T>
- Type Parameters:
T- the result of the completion stage
- All Superinterfaces:
CompletionStage<T>
- All Known Implementing Classes:
BaseCentralisedFuture, CentralisedFuture, IndifferentCentralisedFuture
An extended interface to
The contract of the Sync methods is that they run according to the specifications of
CompletionStage providing a fourth variant of methods in the form
do, doAsync, doAsync; doSync, where do is the general stage consuming operation. The contract of the Sync methods is that they run according to the specifications of
SynchronousExecutor, that is, identically as if ran with the corresponding Async
method variant using SynchronousExecutor.executeSync(Runnable) as the functional
Executor argument. For example, the following should be equivalent:
stage.thenRunSync(() -> doSomething());
stage.thenRunAsync(() -> doSomething(), syncExecutor::executeSync);
where stage is an instance of this interface and syncExecutor is the implementation
of SynchronousExecutor for the application.- Author:
- A248
-
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) acceptEitherSync(CompletionStage<? extends T> other, Consumer<? super T> action) <U> ReactionStage<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> ReactionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> ReactionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) <U> ReactionStage<U> applyToEitherSync(CompletionStage<? extends T> other, Function<? super T, U> fn) exceptionally(Function<Throwable, ? extends T> fn) <U> ReactionStage<U> handle(BiFunction<? super T, Throwable, ? extends U> fn) <U> ReactionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) <U> ReactionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) <U> ReactionStage<U> handleSync(BiFunction<? super T, Throwable, ? extends U> fn) runAfterBoth(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) runAfterBothSync(CompletionStage<?> other, Runnable action) runAfterEither(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) runAfterEitherSync(CompletionStage<?> other, Runnable action) thenAccept(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action, Executor executor) <U> ReactionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> ReactionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> ReactionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) <U> ReactionStage<Void> thenAcceptBothSync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) thenAcceptSync(Consumer<? super T> action) <U> ReactionStage<U> <U> ReactionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn) <U> ReactionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) <U> ReactionStage<U> thenApplySync(Function<? super T, ? extends U> fn) <U,V> ReactionStage <V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> ReactionStage <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> ReactionStage <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) <U,V> ReactionStage <V> thenCombineSync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U> ReactionStage<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) <U> ReactionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) <U> ReactionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) <U> ReactionStage<U> thenComposeSync(Function<? super T, ? extends CompletionStage<U>> fn) thenRunAsync(Runnable action) thenRunAsync(Runnable action, Executor executor) thenRunSync(Runnable action) Converts to an equivalent CentralisedFuture with the same completion properties as this.whenComplete(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) whenCompleteSync(BiConsumer<? super T, ? super Throwable> action)
-
Method Details
-
thenApply
- Specified by:
thenApplyin interfaceCompletionStage<T>
-
thenApplyAsync
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenApplyAsync
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenApplySync
-
thenAccept
- Specified by:
thenAcceptin interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenAcceptSync
-
thenRun
- Specified by:
thenRunin interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenRunSync
-
thenCombine
<U,V> ReactionStage<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombinein interfaceCompletionStage<T>
-
thenCombineAsync
<U,V> ReactionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenCombineAsync
<U,V> ReactionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenCombineSync
<U,V> ReactionStage<V> thenCombineSync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) -
thenAcceptBoth
<U> ReactionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothin interfaceCompletionStage<T>
-
thenAcceptBothAsync
<U> ReactionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
thenAcceptBothAsync
<U> ReactionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
thenAcceptBothSync
<U> ReactionStage<Void> thenAcceptBothSync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) -
runAfterBoth
- Specified by:
runAfterBothin interfaceCompletionStage<T>
-
runAfterBothAsync
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
runAfterBothAsync
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
runAfterBothSync
-
applyToEither
- Specified by:
applyToEitherin interfaceCompletionStage<T>
-
applyToEitherAsync
<U> ReactionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
applyToEitherAsync
<U> ReactionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
applyToEitherSync
<U> ReactionStage<U> applyToEitherSync(CompletionStage<? extends T> other, Function<? super T, U> fn) -
acceptEither
- Specified by:
acceptEitherin interfaceCompletionStage<T>
-
acceptEitherAsync
ReactionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
acceptEitherAsync
ReactionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
acceptEitherSync
ReactionStage<Void> acceptEitherSync(CompletionStage<? extends T> other, Consumer<? super T> action) -
runAfterEither
- Specified by:
runAfterEitherin interfaceCompletionStage<T>
-
runAfterEitherAsync
- Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
runAfterEitherAsync
ReactionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
runAfterEitherSync
-
thenCompose
- Specified by:
thenComposein interfaceCompletionStage<T>
-
thenComposeAsync
- Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
thenComposeAsync
<U> ReactionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) - Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
thenComposeSync
-
handle
- Specified by:
handlein interfaceCompletionStage<T>
-
handleAsync
- Specified by:
handleAsyncin interfaceCompletionStage<T>
-
handleAsync
<U> ReactionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) - Specified by:
handleAsyncin interfaceCompletionStage<T>
-
handleSync
-
whenComplete
- Specified by:
whenCompletein interfaceCompletionStage<T>
-
whenCompleteAsync
- Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
whenCompleteAsync
ReactionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) - Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
whenCompleteSync
-
exceptionally
- Specified by:
exceptionallyin interfaceCompletionStage<T>
-
toCompletableFuture
CentralisedFuture<T> toCompletableFuture()Converts to an equivalent CentralisedFuture with the same completion properties as this.- Specified by:
toCompletableFuturein interfaceCompletionStage<T>- Returns:
- the centralised future
-