Strategy.Token
Constructor and Description |
---|
SimpleStrategy() |
SimpleStrategy(MetricRegistry registry) |
Modifier and Type | Method and Description |
---|---|
void |
setLimit(int limit)
Update the strategy with a new limit
|
java.lang.String |
toString() |
Strategy.Token |
tryAcquire(T context)
Try to acquire a token from the limiter.
|
public SimpleStrategy()
public SimpleStrategy(MetricRegistry registry)
public Strategy.Token tryAcquire(T context)
Strategy
tryAcquire
in interface Strategy<T>
context
- Context of the request for partitioned limitsStrategy.Token
that must be released when
the operation completes.public void setLimit(int limit)
Strategy
public java.lang.String toString()
toString
in class java.lang.Object