Package 

Class SimpleRateLimiter


  • 
    public class SimpleRateLimiter
    
                        

    Rate limiter that only supports non-blocking retrieval of a single token at a minimum rate of 1 per second. Tokens are not smoothed across the second.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final int capacity
    • Method Summary

      Modifier and Type Method Description
      int getCapacity()
      boolean tryAcquire()
      • Methods inherited from class java.lang.Object

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

      • SimpleRateLimiter

        SimpleRateLimiter(int rate)