-
- All Implemented Interfaces:
-
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public final class TaskExecutor extends ThreadPoolExecutor
Executor for tasks that guarantee that only one instance with the same identifier will be run
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringINTENT_WORK_FINISHED
-
Method Summary
Modifier and Type Method Description static TaskExecutorprovide(Context context)Future<out Object>submit(TaskRunnable task)Submit a new task to the executor. booleanisBusy()Is the task executor currently busy at running tasks voidexecute(Runnable command)-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, toString -
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAny, submit, submit -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
provide
static TaskExecutor provide(Context context)
-
submit
Future<out Object> submit(TaskRunnable task)
Submit a new task to the executor.If a task with the same identifier is running, it will be cancelIf a task with the same identifier is in queue, it will be removed.
-
isBusy
boolean isBusy()
Is the task executor currently busy at running tasks
-
-
-
-