RateLimiterBucket4jHazelcastRateLimiter, Bucket4jIgniteRateLimiter, Bucket4jInfinispanRateLimiter, Bucket4jJCacheRateLimiter, RedisRateLimiterpublic abstract class AbstractCacheRateLimiter extends Object implements RateLimiter
QUOTA_SUFFIX| Constructor | Description |
|---|---|
AbstractCacheRateLimiter() |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
calcRemainingLimit(Long limit,
Long refreshInterval,
Long requestTime,
String key,
Rate rate) |
|
protected abstract void |
calcRemainingQuota(Long quota,
Long refreshInterval,
Long requestTime,
String key,
Rate rate) |
|
Rate |
consume(RateLimitProperties.Policy policy,
String key,
Long requestTime) |
public Rate consume(RateLimitProperties.Policy policy, String key, Long requestTime)
consume in interface RateLimiterpolicy - Template for which rates should be created in case there's no rate limit associated with the
keykey - Unique key that identifies a requestrequestTime - The total time it took to handle the requestprotected abstract void calcRemainingLimit(Long limit, Long refreshInterval, Long requestTime, String key, Rate rate)
Copyright © 2019. All rights reserved.