public class SimpleSlidingWindowRateLimiter extends Object implements RateLimiter
REMAIN_FACTOR| 构造器和说明 |
|---|
SimpleSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer,
int limit,
long windowSize) |
SimpleSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer,
int limit,
long windowSize,
float remainFactor) |
public SimpleSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer, int limit, long windowSize)
public SimpleSlidingWindowRateLimiter(TaskEnforcer<TaskParams> taskEnforcer, 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)public boolean tryAcquire(long tryAcquireRemain)
throws InternalErrorException
Copyright © 2022. All rights reserved.