public interface TaskQueue extends TaskIterator
Methods in this interface are expected to be called concurrently. For example, tasks may be added to or removed from the queue while a scheduling iteration using this queue is in progress. Implementations must handle this.
Modifier and Type | Interface and Description |
---|---|
static class |
TaskQueue.TaskState
Tasks in a queue are said to be in one of two states.
|
Modifier and Type | Method and Description |
---|---|
void |
queueTask(QueuableTask task)
Add a task to the queue.
|
void |
setSla(TaskQueueSla sla)
Set SLA for the queue.
|
next
void queueTask(QueuableTask task)
TaskSchedulingService.initializeRunningTask(QueuableTask, String)
.
This operation is designed to be performed asynchronously, when it is safe to modify the queue. The queue implementations generally do not modify the queue while a scheduling iteration is in progress.
task
- A task to add to the queue.void setSla(TaskQueueSla sla) throws java.lang.IllegalArgumentException
TaskQueueSla
that is
accepted.sla
- The SLA to set for the queue.java.lang.IllegalArgumentException
- if the implementation of the TaskQueueSla
is incompatible with the
queue implementation.