Package com.hazelcast.collection
Interface IQueue<E>
- Type Parameters:
- E- queue item type
- All Superinterfaces:
- BaseQueue<E>,- BlockingQueue<E>,- Collection<E>,- DistributedObject,- ICollection<E>,- Iterable<E>,- Queue<E>
Concurrent, blocking, distributed, observable queue.
 
The IQueue is not a partitioned data-structure. All the content of an IQueue is stored in a single machine (and in the backup). The IQueue will not scale by adding more members to the cluster.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionReturns LocalQueueStats for this queue.poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty.Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.take()Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.Methods inherited from interface java.util.concurrent.BlockingQueueadd, contains, drainTo, drainTo, offer, offer, put, remainingCapacity, removeMethods inherited from interface java.util.CollectionaddAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface com.hazelcast.core.DistributedObjectdestroy, getDestroyContextForTenant, getPartitionKey, getServiceNameMethods inherited from interface com.hazelcast.collection.ICollectionaddItemListener, getName, removeItemListener
- 
Method Details- 
pollE poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty.
- 
pollRetrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
- pollin interface- BaseQueue<E>
- Specified by:
- pollin interface- BlockingQueue<E>
- Parameters:
- timeout- how long to wait before giving up, in units of- unit
- unit- a- TimeUnitdetermining how to interpret the- timeoutparameter
- Returns:
- the head of this queue, or nullif the specified waiting time elapses before an element is available
- Throws:
- InterruptedException- if interrupted while waiting
 
- 
takeRetrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Specified by:
- takein interface- BaseQueue<E>
- Specified by:
- takein interface- BlockingQueue<E>
- Returns:
- the head of this queue
- Throws:
- InterruptedException- if interrupted while waiting
 
- 
getLocalQueueStatsLocalQueueStats getLocalQueueStats()Returns LocalQueueStats for this queue. LocalQueueStats is the statistics for the local portion of this queue.- Returns:
- this queue's local statistics.
 
 
-