CompletionStage that provides the same threading semantics and guarantees as the underlying
Future, which means that all the callbacks will be executed by executor()
if not specified otherwise (by calling the corresponding *Async methods).
This interface also extends java., to provide blocking methods for awaiting the result
of the future.
This is in contrast to the Netty Future, which is entirely non-blocking.
Please be aware that FutureCompletionStage#toCompletableFuture() is not supported and so will throw
an UnsupportedOperationException when invoked.
| Modifier and Type | Method and Description |
|---|---|
| public FutureCompletionStage | acceptEither(CompletionStage<? extends V>
the other CompletionStage other, Consumer<? super V> the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | acceptEitherAsync(CompletionStage<? extends V>
the other CompletionStage other, Consumer<? super V> the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | acceptEitherAsync(CompletionStage<? extends V>
the other CompletionStage other, Consumer<? super V> the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public <U> FutureCompletionStage | applyToEither(CompletionStage<? extends V>
the other CompletionStage other, Function<? super V, U> the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | applyToEitherAsync(CompletionStage<? extends V>
the other CompletionStage other, Function<? super V, U> the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | applyToEitherAsync(CompletionStage<? extends V>
the other CompletionStage other, Function<? super V, U> the function to use to compute the value of the
returned CompletionStage fn, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public FutureCompletionStage | |
| public boolean | |
| public default boolean | cancel()
Implements io. |
| public default Throwable | cause()
Implements io. |
| public FutureCompletionStage | exceptionally(Function<Throwable, ? extends V>
the function to use to compute the value of the
returned CompletionStage if this CompletionStage completed
exceptionally fn)Redeclares java. |
| public default EventExecutor | executor()
Implements io. EventExecutor that is tied to this Promise or Future.
|
| public Future | |
| public default Throwable | Returns: The exception that caused the future to fail, if any, ornull.Wait for the future to complete, and return the cause if it failed, or |
| public default V | getNow()
Implements io. |
| public <U> FutureCompletionStage | handle(BiFunction<? super V, Throwable, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | handleAsync(BiFunction<? super V, Throwable, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | handleAsync(BiFunction<? super V, Throwable, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public default boolean | isCancellable()
Implements io. true if and only if the operation can be cancelled via cancel().
|
| public default boolean | isFailed()
Implements io. true if and only if the operation was completed and failed.
|
| public default boolean | isSuccess()
Implements io. true if and only if the operation was completed successfully.
|
| public default < The return type of the T> TresultHandler. | Returns: The result of theresultHandler computation.The function that will process the result of the completed future. resultHandler)Waits for the future to complete, then calls the given result handler with the outcome. |
| public FutureCompletionStage | runAfterBoth(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | runAfterBothAsync(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | runAfterBothAsync(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public FutureCompletionStage | runAfterEither(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | runAfterEitherAsync(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | runAfterEitherAsync(CompletionStage<?>
the other CompletionStage other, Runnable the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public FutureCompletionStage | sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future failed. |
| public FutureCompletionStage | thenAccept(Consumer<? super V>
the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | thenAcceptAsync(Consumer<? super V>
the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | thenAcceptAsync(Consumer<? super V>
the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public <U> FutureCompletionStage | thenAcceptBoth(CompletionStage<? extends U>
the other CompletionStage other, BiConsumer<? super V, ? super U> the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public <U> FutureCompletionStage | thenAcceptBothAsync(CompletionStage<? extends U>
the other CompletionStage other, BiConsumer<? super V, ? super U> the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public <U> FutureCompletionStage | thenAcceptBothAsync(CompletionStage<? extends U>
the other CompletionStage other, BiConsumer<? super V, ? super U> the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public <U> FutureCompletionStage | thenApply(Function<? super V, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | thenApplyAsync(Function<? super V, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | thenApplyAsync(Function<? super V, ? extends U>
the function to use to compute the value of the
returned CompletionStage fn, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public <U, V1> FutureCompletionStage | thenCombine(CompletionStage<? extends U>
the other CompletionStage other, BiFunction<? super V, ? super U, ? extends V1> the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U, V1> FutureCompletionStage | thenCombineAsync(CompletionStage<? extends U>
the other CompletionStage other, BiFunction<? super V, ? super U, ? extends V1> the function to use to compute the value of the
returned CompletionStage fn)Redeclares java. |
| public <U, V1> FutureCompletionStage | thenCombineAsync(CompletionStage<? extends U>
the other CompletionStage other, BiFunction<? super V, ? super U, ? extends V1> the function to use to compute the value of the
returned CompletionStage fn, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public <U> FutureCompletionStage | thenCompose(Function<? super V, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | thenComposeAsync(Function<? super V, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage fn)Redeclares java. |
| public <U> FutureCompletionStage | thenComposeAsync(Function<? super V, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage fn, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public FutureCompletionStage | thenRun(Runnable
the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | thenRunAsync(Runnable
the action to perform before completing the
returned CompletionStage action)Redeclares java. |
| public FutureCompletionStage | thenRunAsync(Runnable
the action to perform before completing the
returned CompletionStage action, Executor the executor to use for asynchronous execution executor)Redeclares java. |
| public default CompletableFuture | toCompletableFuture()
Implements java. UnsupportedOperationException.
|
| public static <U> FutureCompletionStage | toFutureCompletionStage(CompletionStage<U> stage, EventExecutor executor)
Returns a |
| public FutureCompletionStage | whenComplete(BiConsumer<? super V, ? super Throwable>
the action to perform action)Redeclares java. |
| public FutureCompletionStage | whenCompleteAsync(BiConsumer<? super V, ? super Throwable>
the action to perform action)Redeclares java. |
| public FutureCompletionStage | whenCompleteAsync(BiConsumer<? super V, ? super Throwable>
the action to perform action, Executor the executor to use for asynchronous execution executor)Redeclares java. |