| Constructor and Description |
|---|
DefaultCountBasedThrottle() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
open(long threshold)
打开节流器。节流器是否能打开取决于节流指标的数值是否达到或超过阈值。
节流开始的时间由实现类定义,一般情况下是节流器生成即开始,也可延迟开始。
|
public boolean open(long threshold)
ThrottleThrottle throttle = ...创建一个以时间为指标,单位为毫秒的节流器... ; throttle.open(300); //在时间流逝未达到300毫秒时返回false。