Uses of Class
io.github.teceli.resiliencia.patterns.ratelimiter.RateLimiter
Packages that use RateLimiter
-
Uses of RateLimiter in io.github.teceli.resiliencia.patterns.ratelimiter
Methods in io.github.teceli.resiliencia.patterns.ratelimiter that return RateLimiterModifier and TypeMethodDescriptionstatic <T> RateLimiter<T> ARateLimiterallowinglimitcalls perperiod, rejecting excess calls immediately (maxWaitzero).Use a customClockinstead of the system clock, e.g. a manual/virtual clock in tests to make window and wait assertions deterministic and instant.RateLimiter.withLimit(int limit) Maximum number of calls allowed perperiod.RateLimiter.withListener(ResilienceEvent.Listener listener) Add a listener notified of everyRateLimiterEventemitted by this instance.RateLimiter.withMaxWait(Duration maxWait) How long an excess call may wait for the next window before being rejected.RateLimiter.withPeriod(Duration period) Length of the fixed window over whichlimitcalls are allowed.