Interface BlockingQueueConsumerOps<T>

Type Parameters:
T - queue element type
All Known Implementing Classes:
DatabaseChangeConsumerOps

public interface BlockingQueueConsumerOps<T>
Subset of the BlockingQueue interface that should be exposed to consumers.
  • Method Summary

    Modifier and Type
    Method
    Description
    poll(long timeout, 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.
    Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
  • Method Details

    • take

      T take() throws InterruptedException
      Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
      Returns:
      the head of this queue
      Throws:
      InterruptedException - if interrupted while waiting
    • poll

      T poll(long timeout, TimeUnit unit) throws InterruptedException
      Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
      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:
      InterruptedException - if interrupted while waiting