public interface SubmitterExecutor
extends java.util.concurrent.Executor
Modifier and Type | Method and Description |
---|---|
<T> ListenableFuture<T> |
submit(java.util.concurrent.Callable<T> task)
Submit a
Callable to run as soon as possible. |
default ListenableFuture<?> |
submit(java.lang.Runnable task)
Submit a task to run as soon as possible.
|
<T> ListenableFuture<T> |
submit(java.lang.Runnable task,
T result)
Submit a task to run as soon as possible.
|
default ListenableFuture<?> submit(java.lang.Runnable task)
submit(Runnable)
over Executor.execute(Runnable)
. So this should only be used when
the returned future is necessary.
The Future.get()
method will return null
once the runnable has
completed.
task
- runnable to be executed<T> ListenableFuture<T> submit(java.lang.Runnable task, T result)
Future.get()
method will
return the provided result once the runnable has completed.T
- type of result for futuretask
- runnable to be executedresult
- result to be returned from resulting future .get() when runnable completes<T> ListenableFuture<T> submit(java.util.concurrent.Callable<T> task)
Callable
to run as soon as possible. This is needed when a result needs to
be consumed from the callable.T
- type of result returned from the futuretask
- callable to be executed