Class PriorityBlockingDrainingQueue<T extends PriorityBlockingDrainingQueue.Item>

  • Type Parameters:
    T - Type of item,

    public class PriorityBlockingDrainingQueue<T extends PriorityBlockingDrainingQueue.Item>
    extends AbstractDrainingQueue<T>
    AbstractDrainingQueue implementation with multiple priority levels. Supports up to Byte.MAX_VALUE priority levels, with Priority 0 being the highest.

    Important notes: - AbstractDrainingQueue.poll(int) and AbstractDrainingQueue.take(int) will return items with the highest available priority and will never mix items with different priorities. That means that, even if there are more items (with lower priority), those will not be included in the result even if the requested number of items exceeds what we can return. These (lower priority) items may be retrieved using a subsequent call (assuming no higher priority items are added in the meantime).