public abstract class AbstractLimit extends java.lang.Object implements Limit
Modifier | Constructor and Description |
---|---|
protected |
AbstractLimit(int initialLimit) |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
_update(long startTime,
long rtt,
int inflight,
boolean didDrop) |
int |
getLimit() |
void |
notifyOnChange(java.util.function.Consumer<java.lang.Integer> consumer)
Register a callback to receive notification whenever the limit is updated to a new value
|
void |
onSample(long startTime,
long rtt,
int inflight,
boolean didDrop)
Update the limiter with a sample
|
protected void |
setLimit(int newLimit) |
public final void onSample(long startTime, long rtt, int inflight, boolean didDrop)
Limit
protected abstract int _update(long startTime, long rtt, int inflight, boolean didDrop)
public final int getLimit()
protected void setLimit(int newLimit)
public void notifyOnChange(java.util.function.Consumer<java.lang.Integer> consumer)
Limit
notifyOnChange
in interface Limit