public class DistributedSlidingWindowRateLimiter extends Object implements RateLimiter
REMAIN_FACTOR| 构造器和说明 |
|---|
DistributedSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer,
String key,
int limit,
long windowSize) |
DistributedSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer,
String key,
int limit,
long windowSize,
float remainFactor) |
public DistributedSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer, String key, int limit, long windowSize)
public DistributedSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer, String key, int limit, long windowSize, float remainFactor)
public boolean tryAcquire()
throws InternalErrorException
RateLimitertryAcquire 在接口中 RateLimiterInternalErrorException - if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)public boolean tryAcquireRemain()
throws InternalErrorException
RateLimitertryAcquireRemain 在接口中 RateLimiterInternalErrorException - if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)Copyright © 2022. All rights reserved.