| Constructor and Description |
|---|
DefaultCountBasedThrottle() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
open(long threshold)
打开节流器。节流器是否能打开取决于节流指标的数值是否达到或超过阈值。
节流器创建后立即打开,此时节流指标为0,能否成功也必须遵守threshold参数。
|
public boolean open(long threshold)
ThrottleThrottle throttle = ...创建一个以时间为指标,单位为毫秒的节流器... ; throttle.open(300); //在时间流逝未达到300毫秒时返回false。