public final class AndroidExecutionService extends AbstractExecutionService
ExecutionService.Cancellable, ExecutionService.CloseableExecutor
MIN_CAPACITY
Constructor and Description |
---|
AndroidExecutionService() |
Modifier and Type | Method and Description |
---|---|
void |
cancelDelayedTask(ExecutionService.Cancellable cancellableTask)
Best effort, delete the passed task (obtained from postDelayedOnExecutor, above)
from the wait queue.
|
Executor |
getMainExecutor()
Get the main executor.
|
ExecutionService.Cancellable |
postDelayedOnExecutor(long delayMs,
Executor executor,
Runnable task)
This runs a task on Android's main thread for just long enough to enough to enqueue the passed task
on the passed executor.
|
getConcurrentExecutor, getSerialExecutor
@NonNull public Executor getMainExecutor()
ExecutionService
@NonNull public 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
- an executor on which to execute the task.task
- the task to be executed.public void cancelDelayedTask(@NonNull ExecutionService.Cancellable cancellableTask)
cancellableTask
- returned by a previous call to postDelayedOnExecutor.