public interface RateLimiter
| 限定符和类型 | 字段和说明 |
|---|---|
static float |
REMAIN_FACTOR
剩余令牌因子
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
tryAcquire()
尝试获取令牌
|
boolean |
tryAcquireRemain()
尝试获取令牌(只有剩余令牌超过界限后才会获取令牌)
|
static final float REMAIN_FACTOR
boolean tryAcquire()
throws InternalErrorException
InternalErrorException - if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)boolean tryAcquireRemain()
throws InternalErrorException
InternalErrorException - if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)Copyright © 2022. All rights reserved.