Class RateLimiterConfig<R>
java.lang.Object
dev.failsafe.PolicyConfig<R>
dev.failsafe.RateLimiterConfig<R>
- Type Parameters:
R- result type
Configuration for a
RateLimiter.- Author:
- Jonathan Halterman
-
Method Summary
Modifier and TypeMethodDescriptionlongFor bursty rate limiters, returns the max permitted executions perperiod, elsenullif the rate limiter is not bursty.For smooth rate limiters, returns the max rate at which individual executions are permitted, elsenullif the rate limiter is not smooth.Returns the max time to wait for permits to be available.For bursty rate limiters, returns the period after which permits are reset tomaxPermits, elsenullif the rate limiter is not bursty.Methods inherited from class PolicyConfig
getFailureListener, getSuccessListener
-
Method Details
-
getMaxRate
For smooth rate limiters, returns the max rate at which individual executions are permitted, elsenullif the rate limiter is not smooth.- See Also:
-
getMaxPermits
public long getMaxPermits()For bursty rate limiters, returns the max permitted executions perperiod, elsenullif the rate limiter is not bursty.- See Also:
-
getPeriod
For bursty rate limiters, returns the period after which permits are reset tomaxPermits, elsenullif the rate limiter is not bursty.- See Also:
-
getMaxWaitTime
Returns the max time to wait for permits to be available. If permits cannot be acquired before the max wait time is exceeded, then the rate limiter will throwRateLimitExceededException.This setting only applies when the RateLimiter is used with the
Failsafeclass. It does not apply when the RateLimiter is used in a standalone way.- See Also:
-