T - public class RunnableCallableFuture<T> extends SettableFuture<T> implements Runnable, RunnableFuture<T>
| Constructor and Description |
|---|
RunnableCallableFuture(Callable<T> callable) |
| Modifier and Type | Method and Description |
|---|---|
Future<T> |
asyncRun()
Start a new daemon thread to call the run() method asynchronously, returning this object as a Future (and not a
RunnableCallableFuture)
|
static <T> Future<T> |
asyncRun(Callable<T> callable)
Takes a Callable, executing it in the background, returning a Future to its result
Users are advised to use a ThreadPool instead of this method. |
Future<T> |
asyncRun(Executor executor)
Runs this Callable asynchronously using the specified
Executor |
void |
run() |
String |
toString() |
cancel, cancel, fail, get, get, get, isCancelled, isDone, on_cancel, on_set, poll, setpublic void run()
run in interface Runnablerun in interface RunnableFuture<T>public Future<T> asyncRun()
public Future<T> asyncRun(Executor executor)
Executorexecutor - public String toString()
toString in class ObjectObject.toString()public static <T> Future<T> asyncRun(Callable<T> callable)
T - the return typecallable - the callable to return a Future toCopyright © 2017. All rights reserved.