Class PendingRequestThrottler


  • public class PendingRequestThrottler
    extends java.lang.Object
    This class maintains a simple counter for capacity management.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCurrentPendingRequestCount()  
      boolean put()
      When the incoming put() exceeds the pre-defined counter, 'false' will be returned.
      void take()
      The following function will decrease the counter by 1 to recover the capacity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PendingRequestThrottler

        public PendingRequestThrottler​(long maxPendingRequest)
    • Method Detail

      • put

        public boolean put()
        When the incoming put() exceeds the pre-defined counter, 'false' will be returned.
        Returns:
      • take

        public void take()
        The following function will decrease the counter by 1 to recover the capacity.
      • getCurrentPendingRequestCount

        public long getCurrentPendingRequestCount()