T
- Runnable
, Future<T>
, RunnableFuture<T>
public class RunnableCallableFuture<T> extends SettableFuture<T> implements Runnable, RunnableFuture<T>
Constructor | Description |
---|---|
RunnableCallableFuture(Callable<T> callable) |
Modifier and Type | Method | 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() |
public void run()
run
in interface Runnable
run
in interface RunnableFuture<T>
public Future<T> asyncRun()
public Future<T> asyncRun(Executor executor)
Executor
executor
- public String toString()
toString
in class Object
Object.toString()
public static <T> Future<T> asyncRun(Callable<T> callable)
T
- the return typecallable
- the callable to return a Future toCopyright © 2018. All rights reserved.