public final class OperationQueueImpl extends Object implements OperationQueue
Constructor and Description |
---|
OperationQueueImpl() |
OperationQueueImpl(BlockingQueue<Object> normalQueue,
Queue<Object> priorityQueue) |
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.
|
public OperationQueueImpl()
public OperationQueueImpl(BlockingQueue<Object> normalQueue, Queue<Object> priorityQueue)
public int normalSize()
OperationQueue
normalSize
in interface OperationQueue
public int prioritySize()
OperationQueue
prioritySize
in interface OperationQueue
public int size()
OperationQueue
size
in interface OperationQueue
public void add(Object task, boolean priority)
OperationQueue
add
in interface OperationQueue
task
- the item to addpriority
- if the task has priority or notpublic Object take(boolean priorityOnly) throws InterruptedException
OperationQueue
take
in interface OperationQueue
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.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.