public interface SchedulerService extends SubmitterScheduler
Modifier and Type | Method and Description |
---|---|
int |
getActiveTaskCount()
Call to check how many tasks are currently being executed in this scheduler.
|
int |
getQueuedTaskCount()
Returns how many tasks are either waiting to be executed, or are scheduled to be executed at
a future point.
|
int |
getWaitingForExecutionTaskCount()
Returns how many tasks are either waiting to be executed.
|
boolean |
isShutdown()
Function to check if the thread pool is currently accepting and handling tasks.
|
boolean |
remove(java.util.concurrent.Callable<?> task)
Removes the callable task from the execution queue.
|
boolean |
remove(java.lang.Runnable task)
Removes the runnable task from the execution queue.
|
schedule, scheduleAtFixedRate, scheduleWithFixedDelay, submitScheduled, submitScheduled, submitScheduled
submit, submit, submit
boolean remove(java.lang.Runnable task)
Note that this call has high guarantees on the ability to remove the task (as in a complete guarantee). But while this is being invoked, it will reduce the throughput of execution, so should NOT be used extremely frequently.
For non-recurring tasks using a future and calling
Future.cancel(boolean)
can be a better solution.
task
- The original runnable provided to the executortrue
if the runnable was found and removedboolean remove(java.util.concurrent.Callable<?> task)
Note that this call has high guarantees on the ability to remove the task (as in a complete guarantee). But while this is being invoked, it will reduce the throughput of execution, so should NOT be used extremely frequently.
For non-recurring tasks using a future and calling
Future.cancel(boolean)
can be a better solution.
task
- The original callable provided to the executortrue
if the callable was found and removedint getActiveTaskCount()
int getQueuedTaskCount()
getWaitingForExecutionTaskCount()
.int getWaitingForExecutionTaskCount()
boolean isShutdown()
true
if thread pool is running