T - public class RunnableCallableFuture<T> extends SettableFuture<T> implements java.lang.Runnable, java.util.concurrent.RunnableFuture<T>
| Constructor and Description |
|---|
RunnableCallableFuture(java.util.concurrent.Callable<T> callable) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.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> java.util.concurrent.Future<T> |
asyncRun(java.util.concurrent.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. |
java.util.concurrent.Future<T> |
asyncRun(java.util.concurrent.Executor executor)
Runs this Callable asynchronously using the specified
Executor |
void |
run() |
java.lang.String |
toString() |
cancel, cancel, fail, get, get, get, isCancelled, isDone, on_cancel, on_set, poll, setpublic RunnableCallableFuture(java.util.concurrent.Callable<T> callable)
public void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<T>public java.util.concurrent.Future<T> asyncRun()
public java.util.concurrent.Future<T> asyncRun(java.util.concurrent.Executor executor)
Executorexecutor - public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public static <T> java.util.concurrent.Future<T> asyncRun(java.util.concurrent.Callable<T> callable)
T - the return typecallable - the callable to return a Future toCopyright © 2014. All Rights Reserved.