Buckets

object Buckets(source)

Collection of factories to create a BucketConfiguration.

Functions

Link copied to clipboard
@JvmName(name = "createCustom")
fun custom(vararg limits: Bandwidth): BucketConfiguration
@JvmName(name = "createCustom")
fun custom(limits: List<Bandwidth>): BucketConfiguration
Link copied to clipboard
@JvmName(name = "createDefault")
fun default(capacity: Long, duration: Duration): BucketConfiguration

Creates a BucketConfiguration with a Bandwidth of the specified capacity, and a greedy refill.

fun default(capacity: Long, duration: Duration): BucketConfiguration

Creates a BucketConfiguration with a simple Bandwidth of the specified capacity, and a greedy refill.

Link copied to clipboard

Creates a BucketConfiguration with a single token, which gets regenerated after the given duration.

Link copied to clipboard
@JvmName(name = "createSpikeProtected")
fun spikeProtected(capacity: Long, duration: Duration, spikeCapacity: Long, spikeDuration: Duration): BucketConfiguration
fun spikeProtected(capacity: Long, duration: Duration, spikeCapacity: Long, spikeDuration: Duration): BucketConfiguration

Creates a BucketConfiguration with: