Package | Description |
---|---|
io.github.bucket4j |
Modifier and Type | Method and Description |
---|---|
static Bandwidth |
Bandwidth.classic(long capacity,
Refill refill)
Specifies limitation in classic interpretation of token-bucket algorithm.
|
Bandwidth[] |
BucketConfiguration.getBandwidths() |
static Bandwidth |
Bandwidth.simple(long capacity,
Duration period)
Specifies simple limitation capacity tokens per period time window.
|
Bandwidth |
Bandwidth.withFixedRefillInterval(Duration fixedRefillInterval)
Creates the copy of current bandwidth for which the greediness of refill is switched-off.
|
Bandwidth |
Bandwidth.withInitialTokens(long initialTokens)
By default new created bandwidth has amount of tokens that equals its capacity.
|
Modifier and Type | Method and Description |
---|---|
ConfigurationBuilder |
ConfigurationBuilder.addLimit(Bandwidth bandwidth)
Adds limited bandwidth for all buckets which will be constructed by this builder instance.
|
T |
AbstractBucketBuilder.addLimit(Bandwidth bandwidth)
Adds limited bandwidth for all buckets which will be constructed by this builder.
|
void |
BucketState.addTokens(Bandwidth[] limits,
long tokensToAdd) |
void |
BucketState.consume(Bandwidth[] bandwidths,
long toConsume) |
long |
BucketState.delayNanosAfterWillBePossibleToConsume(Bandwidth[] bandwidths,
long tokensToConsume) |
long |
BucketState.getAvailableTokens(Bandwidth[] bandwidths) |
void |
BucketState.refillAllBandwidth(Bandwidth[] limits,
long currentTimeNanos) |
Constructor and Description |
---|
BucketConfiguration(List<Bandwidth> bandwidths) |
Copyright © 2018. All rights reserved.