Interface IQueue<E>

  • Type Parameters:
    E - queue item type
    All Superinterfaces:
    BaseQueue<E>, java.util.concurrent.BlockingQueue<E>, java.util.Collection<E>, DistributedObject, ICollection<E>, java.lang.Iterable<E>, java.util.Queue<E>

    public interface IQueue<E>
    extends java.util.concurrent.BlockingQueue<E>, BaseQueue<E>, ICollection<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:
    BaseQueue, Queue, BlockingQueue, TransactionalQueue
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      LocalQueueStats getLocalQueueStats()
      Returns LocalQueueStats for this queue.
      E poll()
      Retrieves and removes the head of this queue, or returns null if this queue is empty.
      E poll​(long timeout, java.util.concurrent.TimeUnit unit)
      Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
      E take()
      Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
      • Methods inherited from interface java.util.concurrent.BlockingQueue

        add, contains, drainTo, drainTo, offer, offer, put, remainingCapacity, remove
      • Methods inherited from interface java.util.Collection

        addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Queue

        element, peek, remove
    • Method Detail

      • poll

        E poll()
        Retrieves and removes the head of this queue, or returns null if this queue is empty.
        Specified by:
        poll in interface BaseQueue<E>
        Specified by:
        poll in interface java.util.Queue<E>
        Returns:
        the head of this queue, or null if this queue is empty
      • poll

        E poll​(long timeout,
               @Nonnull
               java.util.concurrent.TimeUnit unit)
        throws java.lang.InterruptedException
        Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
        Specified by:
        poll in interface BaseQueue<E>
        Specified by:
        poll in interface java.util.concurrent.BlockingQueue<E>
        Parameters:
        timeout - how long to wait before giving up, in units of unit
        unit - a TimeUnit determining how to interpret the timeout parameter
        Returns:
        the head of this queue, or null if the specified waiting time elapses before an element is available
        Throws:
        java.lang.InterruptedException - if interrupted while waiting
      • take

        @Nonnull
        E take()
        throws java.lang.InterruptedException
        Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
        Specified by:
        take in interface BaseQueue<E>
        Specified by:
        take in interface java.util.concurrent.BlockingQueue<E>
        Returns:
        the head of this queue
        Throws:
        java.lang.InterruptedException - if interrupted while waiting
      • getLocalQueueStats

        LocalQueueStats getLocalQueueStats()
        Returns LocalQueueStats for this queue. LocalQueueStats is the statistics for the local portion of this queue.
        Returns:
        this queue's local statistics.