SuspendingBucketConfiguration

data class SuspendingBucketConfiguration(var timeMeter: TimeMeter = TimeMeter.SYSTEM_MILLISECONDS, mutableLimits: MutableList<Bandwidth> = mutableListOf())(source)

Defines the configuration for creating a SuspendingBucket.

Constructors

Link copied to clipboard
constructor(timeMeter: TimeMeter = TimeMeter.SYSTEM_MILLISECONDS, mutableLimits: MutableList<Bandwidth> = mutableListOf())

Properties

Link copied to clipboard
var timeMeter: TimeMeter

Set's the TimeMeter to be used by the underlying Bucket4j objects. By default, you may choose either TimeMeter.SYSTEM_MILLISECONDS or TimeMeter.SYSTEM_NANOSECONDS. Caution: see Bucket4j's documentation about using nanoseconds before choosing that option.

Functions

Link copied to clipboard
fun addLimit(bandwidth: Bandwidth)

Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.

fun addLimit(limit: BandwidthBuilder.BandwidthBuilderCapacityStage.() -> BandwidthBuilder.BandwidthBuilderBuildStage)

Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.