Package dev.failsafe

Class RateLimiterConfig<R>

  • Type Parameters:
    R - result type

    public class RateLimiterConfig<R>
    extends PolicyConfig<R>
    Configuration for a RateLimiter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getMaxPermits()
      For bursty rate limiters, returns the max permitted executions per period, else null if the rate limiter is not bursty.
      java.time.Duration getMaxRate()
      For smooth rate limiters, returns the max rate at which individual executions are permitted, else null if the rate limiter is not smooth.
      java.time.Duration getMaxWaitTime()
      Returns the max time to wait for permits to be available.
      java.time.Duration getPeriod()
      For bursty rate limiters, returns the period after which permits are reset to maxPermits, else null if the rate limiter is not bursty.
      • Methods inherited from class java.lang.Object

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

      • maxRate

        java.time.Duration maxRate
      • maxPermits

        long maxPermits
      • period

        java.time.Duration period
      • maxWaitTime

        java.time.Duration maxWaitTime
    • Constructor Detail

      • RateLimiterConfig

        RateLimiterConfig​(java.time.Duration maxRate)
      • RateLimiterConfig

        RateLimiterConfig​(long maxPermits,
                          java.time.Duration period)