public interface AsyncListenableTaskExecutor extends AsyncTaskExecutor
AsyncTaskExecutor
interface, adding the capability to submit
tasks for ListenableFuture
s.ListenableFuture
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Modifier and Type | Method and Description |
---|---|
<T> ListenableFuture<T> |
submitListenable(Callable<T> task)
Submit a
Callable task for execution, receiving a ListenableFuture
representing that task. |
ListenableFuture<?> |
submitListenable(Runnable task)
Submit a
Runnable task for execution, receiving a ListenableFuture
representing that task. |
execute, submit, submit
execute
ListenableFuture<?> submitListenable(Runnable task)
Runnable
task for execution, receiving a ListenableFuture
representing that task. The Future will return a null
result upon completion.task
- the Runnable
to execute (never null
)ListenableFuture
representing pending completion of the taskTaskRejectedException
- if the given task was not accepted<T> ListenableFuture<T> submitListenable(Callable<T> task)
Callable
task for execution, receiving a ListenableFuture
representing that task. The Future will return the Callable's result upon
completion.task
- the Callable
to execute (never null
)ListenableFuture
representing pending completion of the taskTaskRejectedException
- if the given task was not accepted