public class ComposableFuture<T> extends CompletableFuture<T> implements BiConsumer<T,Throwable>
CompletableFuture with missing utility methods.CompletableFuture.AsynchronousCompletionTask| Constructor and Description |
|---|
ComposableFuture() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(T result,
Throwable error) |
CompletableFuture<T> |
except(Consumer<Throwable> consumer)
Sets a consumer to be called when the future is failed.
|
CompletableFuture<T> |
exceptAsync(Consumer<Throwable> consumer)
Sets a consumer to be called asynchronously when the future is failed.
|
CompletableFuture<T> |
exceptAsync(Consumer<Throwable> consumer,
Executor executor)
Sets a consumer to be called asynchronously when the future is failed.
|
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completedFuture, completeExceptionally, exceptionally, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsyncequals, getClass, hashCode, notify, notifyAll, wait, wait, waitandThenpublic void accept(T result, Throwable error)
accept in interface BiConsumer<T,Throwable>public CompletableFuture<T> except(Consumer<Throwable> consumer)
consumer - The consumer to call.public CompletableFuture<T> exceptAsync(Consumer<Throwable> consumer)
consumer - The consumer to call.public CompletableFuture<T> exceptAsync(Consumer<Throwable> consumer, Executor executor)
consumer - The consumer to call.executor - The executor with which to call the consumer.Copyright © 2013–2016. All rights reserved.