Class BlockingQueueNioQueue

  • All Implemented Interfaces:
    NioQueue

    public class BlockingQueueNioQueue
    extends java.lang.Object
    implements NioQueue
    Bridge between NioQueue and JDK's BlockingQueue.
    Since:
    5.5.0
    See Also:
    NioQueue
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockingQueueNioQueue​(java.util.concurrent.BlockingQueue<WriteRequest> delegate, int writeEnqueuingTimeoutInMs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isEmpty()
      Returns true if the queue contains no element.
      boolean offer​(WriteRequest writeRequest)
      Enqueue a frame, block if the queue is full.
      WriteRequest poll()
      Retrieves and removes the head of this queue, or returns null if this queue is empty.
      int size()
      Get the current size of the queue.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • delegate

        private final java.util.concurrent.BlockingQueue<WriteRequest> delegate
      • writeEnqueuingTimeoutInMs

        private final int writeEnqueuingTimeoutInMs
    • Constructor Detail

      • BlockingQueueNioQueue

        public BlockingQueueNioQueue​(java.util.concurrent.BlockingQueue<WriteRequest> delegate,
                                     int writeEnqueuingTimeoutInMs)
    • Method Detail

      • offer

        public boolean offer​(WriteRequest writeRequest)
                      throws java.lang.InterruptedException
        Description copied from interface: NioQueue
        Enqueue a frame, block if the queue is full.
        Specified by:
        offer in interface NioQueue
        Returns:
        Throws:
        java.lang.InterruptedException
      • size

        public int size()
        Description copied from interface: NioQueue
        Get the current size of the queue.
        Specified by:
        size in interface NioQueue
        Returns:
      • poll

        public WriteRequest poll()
        Description copied from interface: NioQueue
        Retrieves and removes the head of this queue, or returns null if this queue is empty.
        Specified by:
        poll in interface NioQueue
        Returns:
        the head of this queue, or null if this queue is empty
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: NioQueue
        Returns true if the queue contains no element.
        Specified by:
        isEmpty in interface NioQueue
        Returns:
        true if the queue contains no element