public class BlockingRequestQueue<T extends Request<?> & java.lang.Comparable<T>>
extends java.lang.Object
Constructor and Description |
---|
BlockingRequestQueue()
Creates a BlockingRequestQueue with the default 10:1 high priority:low priority ratio.
|
BlockingRequestQueue(int highPerLow) |
public BlockingRequestQueue()
public BlockingRequestQueue(int highPerLow)
highPerLow
- The number of high priority requests to dequeue for every low priority request. (highPerLow:1)public void put(T request)
request
- Request to queue.public com.google.common.base.Optional<T> takeNow() throws java.lang.InterruptedException
Optional.absent()
.java.lang.InterruptedException
public T take() throws java.lang.InterruptedException
java.lang.InterruptedException
public void clear()
public void logState(org.apache.log4j.Logger log)
public int size()