public interface ExecutionService
Modifier and Type | Interface and Description |
---|---|
static interface |
ExecutionService.Cancellable
A Cancellable represents a delayed task that is cancellable.
|
static interface |
ExecutionService.CloseableExecutor
Like an ExecutorService, but simpler.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelDelayedTask(ExecutionService.Cancellable future)
Best effort cancellation of a delayed task.
|
ExecutionService.CloseableExecutor |
getConcurrentExecutor()
Get the concurrent execution service.
|
Executor |
getDefaultExecutor()
Get the main executor.
|
ExecutionService.CloseableExecutor |
getSerialExecutor()
Get a new, serial executor.
|
ExecutionService.Cancellable |
postDelayedOnExecutor(long delayMs,
Executor executor,
Runnable task)
Run the passed task on the passed executor, after a delay
|
@NonNull Executor getDefaultExecutor()
@NonNull ExecutionService.CloseableExecutor getSerialExecutor()
@NonNull ExecutionService.CloseableExecutor getConcurrentExecutor()
@NonNull ExecutionService.Cancellable postDelayedOnExecutor(long delayMs, @NonNull Executor executor, @NonNull Runnable task)
delayMs
- delay before posting the task. There may be additional queue delays in the executor.executor
- a executor on which to execute the task.task
- the task to be executed.void cancelDelayedTask(@NonNull ExecutionService.Cancellable future)
future
- object returned by a previous call to postDelayedOnExecutor.