T - the return type of the asynchronous taskpublic class CancelableFuture<T> extends CompletableFuture<T>
CompletableFuture.AsynchronousCompletionTask| Constructor and Description |
|---|
CancelableFuture(Callable<T> task)
Creates a new CancelableFuture which will be completed by calling the
given
Callable via the provided ExecutorService. |
CancelableFuture(Callable<T> task,
ExecutorService executor)
Creates a new CancelableFuture which will be completed by calling the
given
Callable via the provided ExecutorService. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterrupt) |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, 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, whenCompleteAsyncpublic CancelableFuture(Callable<T> task, ExecutorService executor)
Callable via the provided ExecutorService.task - the task to be executed asynchronouslyexecutor - the thread pool that handles the asynchronous taskpublic CancelableFuture(Callable<T> task)
Callable via the provided ExecutorService.task - the task to be executed asynchronouslyCopyright © 2017–2019. All rights reserved.