类 ThrottleLimitResultQueue<T>


  • public class ThrottleLimitResultQueue<T>
    extends java.lang.Object
    An implementation of the ResultQueue that throttles the number of expected results, limiting it to a maximum at any given time.
    作者:
    Dave Syer
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidexpect()
      Tell the queue to expect one more result.
      booleanisEmpty() 
      booleanisExpecting() 
      voidput​(T holder) 
      Ttake() 
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • ThrottleLimitResultQueue

        public ThrottleLimitResultQueue​(int throttleLimit)
        参数:
        throttleLimit - the maximum number of results that can be expected at any given time.
    • 方法详细资料

      • expect

        public void expect()
                    throws java.lang.InterruptedException
        Tell the queue to expect one more result. Blocks until a new result is available if already expecting too many (as determined by the throttle limit).
        抛出:
        java.lang.InterruptedException
        另请参阅:
        ResultQueue.expect()
      • put

        public void put​(T holder)
                 throws java.lang.IllegalArgumentException
        抛出:
        java.lang.IllegalArgumentException
      • take

        public T take()
               throws java.util.NoSuchElementException,
                      java.lang.InterruptedException
        抛出:
        java.util.NoSuchElementException
        java.lang.InterruptedException