Modifier and Type | Method and Description |
---|---|
<V> ScheduledFuture<V> |
ScheduledExecutorService.schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the given delay.
|
<T> Future<T> |
ExecutorService.submit(Callable<T> task)
Submits a value-returning task for execution and returns a Future representing the pending results of the task.
|
Modifier and Type | Method and Description |
---|---|
<T> java.util.List<Future<T>> |
ExecutorService.invokeAll(java.util.Collection<? extends Callable<T>> tasks)
Executes the given tasks, returning a list of Futures holding their status and results when all complete.
|
<T> java.util.List<Future<T>> |
ExecutorService.invokeAll(java.util.Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the
timeout expires, whichever happens first.
|
<T> T |
ExecutorService.invokeAny(java.util.Collection<? extends Callable<T>> tasks)
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an
exception), if any do.
|
<T> T |
ExecutorService.invokeAny(java.util.Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an
exception), if any do before the given timeout elapses.
|