public class WaitableQueue extends PriorityBlockingQueue<Request<?>>
Constructor and Description |
---|
WaitableQueue() |
Modifier and Type | Method and Description |
---|---|
Request<?> |
take()
Retrieves and removes the head of this queue, waiting if necessary
until an element becomes available.
|
void |
waitUntilEmpty(long timeoutMillis) |
add, clear, comparator, contains, drainTo, drainTo, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, size, spliterator, toArray, toArray, toString
addAll, element, remove
containsAll, isEmpty, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream
public void waitUntilEmpty(long timeoutMillis) throws TimeoutException, InterruptedException
TimeoutException
InterruptedException
public Request<?> take() throws InterruptedException
BlockingQueue
take
in interface BlockingQueue<Request<?>>
take
in class PriorityBlockingQueue<Request<?>>
InterruptedException
- if interrupted while waiting