Interface ConcurrentQueueConsumer<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Remove all elements from the queue.
      int consume​(ConsumerFunction<E> consumer, int batchSize)
      As many elements as are visible are delivered to the Consumer.
      E peek()
      See Queue.peek() for contract.
      E poll()
      See Queue.poll() for contract.
      E weakPeek()
      Return the next element from the queue, but don't remove it.
      E weakPoll()
      Remove the next element from the queue and return it.
    • Method Detail

      • consume

        int consume​(ConsumerFunction<E> consumer,
                    int batchSize)
        As many elements as are visible are delivered to the Consumer.
        Parameters:
        batchSize - this is the limit on the batch consume operation, but it is possible that less are available
        Returns:
        number of elements consumed
      • poll

        E poll()
        See Queue.poll() for contract.
        Returns:
        next element or null if queue is empty
      • weakPoll

        E weakPoll()
        Remove the next element from the queue and return it.
        Returns:
        next element or null if next element is not available (queue may not be empty)
      • peek

        E peek()
        See Queue.peek() for contract.
        Returns:
        next element or null if queue is empty
      • weakPeek

        E weakPeek()
        Return the next element from the queue, but don't remove it.
        Returns:
        next element or null if next element is not available (queue may not be empty)
      • clear

        void clear()
        Remove all elements from the queue. This will not stop the producers from adding new elements, so only guarantees elements visible to the consumer on first sweep are removed.