public class ThrottleLimitResultQueue<T> extends Object
ResultQueue that throttles the number of
 expected results, limiting it to a maximum at any given time.| Constructor and Description | 
|---|
| ThrottleLimitResultQueue(int throttleLimit) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | expect()Tell the queue to expect one more result. | 
| boolean | isEmpty()Used by master thread to verify that there are results available from
  take()without possibly having to block and wait. | 
| boolean | isExpecting()Check if any results are expected. | 
| void | put(T holder)Once it is expecting a result, clients call this method to satisfy the
 expectation. | 
| T | take()Gets the next available result, blocking if there are none yet available. | 
public ThrottleLimitResultQueue(int throttleLimit)
throttleLimit - the maximum number of results that can be expected
 at any given time.public boolean isEmpty()
take() without possibly having to block and wait.public boolean isExpecting()
public void expect()
            throws InterruptedException
InterruptedException - if the call blocks and is then interrupted.ResultQueue.expect()public void put(T holder) throws IllegalArgumentException
holder - the result for later collection.IllegalArgumentException - if the queue is not expecting a new
 resultpublic T take() throws NoSuchElementException, InterruptedException
NoSuchElementException - if there is no result expectedInterruptedException - if the operation is interrupted while
 waitingCopyright © 2014 Pivotal. All rights reserved.