Package | Description |
---|---|
io.github.bucket4j |
Modifier and Type | Field and Description |
---|---|
static SerializationHandle<Bandwidth> |
Bandwidth.SERIALIZATION_HANDLE |
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.withId(String id)
By default new created bandwidth has no ID.
|
Bandwidth |
Bandwidth.withInitialTokens(long initialTokens)
By default new created bandwidth has amount 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) |
long |
BucketState.calculateDelayNanosAfterWillBePossibleToConsume(Bandwidth[] bandwidths,
long tokensToConsume,
long currentTimeNanos) |
void |
BucketState.consume(Bandwidth[] bandwidths,
long toConsume) |
long |
BucketState.getAvailableTokens(Bandwidth[] bandwidths) |
void |
BucketState.refillAllBandwidth(Bandwidth[] limits,
long currentTimeNanos) |
Constructor and Description |
---|
BucketConfiguration(List<Bandwidth> bandwidths) |
Copyright © 2021. All rights reserved.