public interface OperationQueue
GenericOperationThread
share a single queue.
The ScheduledQueue also support priority tasks; so if a task with a priority
comes in, than that one is taken before any other normal operation is taken.
The ordering between normal tasks will always be FIFO. And the same goes for
the ordering between priority tasks, but there is no ordering guarantee between
priority and normal tasks.Modifier and Type | Method and Description |
---|---|
void |
add(Object task,
boolean priority)
Adds an task to this queue.
|
int |
normalSize()
returns the number of normal operations pending.
|
int |
prioritySize()
returns the number of priority operations pending.
|
int |
size()
Returns the total number of pending operations.
|
Object |
take(boolean priorityOnly)
Takes an item from this queue.
|
void add(Object task, boolean priority)
task
- the item to addpriority
- if the task has priority or notNullPointerException
- if task is nullObject take(boolean priorityOnly) throws InterruptedException
priorityOnly
- true if only priority items should be taken. This is
useful for priority generic threads since they
should only take priority items.InterruptedException
- if the thread is interrupted while waiting.int normalSize()
int prioritySize()
int size()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.