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 TypeMethodDescriptionRetrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.take()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
-
Method Details
-
take
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
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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
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
-