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()
OperationQueuenormalSize in interface OperationQueuepublic int prioritySize()
OperationQueueprioritySize in interface OperationQueuepublic int size()
OperationQueuesize in interface OperationQueuepublic void add(Object task, boolean priority)
OperationQueueadd in interface OperationQueuetask - the item to addpriority - if the task has priority or notpublic Object take(boolean priorityOnly) throws InterruptedException
OperationQueuetake in interface OperationQueuepriorityOnly - 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.