Package dev.failsafe

Class RateLimiterBuilder<R>

    • Constructor Detail

      • RateLimiterBuilder

        RateLimiterBuilder​(java.time.Duration executionRate)
      • RateLimiterBuilder

        RateLimiterBuilder​(long maxPermits,
                           java.time.Duration period)
    • Method Detail

      • withMaxWaitTime

        public RateLimiterBuilder<R> withMaxWaitTime​(java.time.Duration maxWaitTime)
        Configures the maxWaitTime to wait for permits to be available. If permits cannot be acquired before the maxWaitTime is exceeded, then the rate limiter will throw RateLimitExceededException.

        This setting only applies when the resulting RateLimiter is used with the Failsafe class. It does not apply when the RateLimiter is used in a standalone way.

        Throws:
        java.lang.NullPointerException - if maxWaitTime is null