diff --git a/bucket4k/com.sletmoe.bucket4k/-suspending-bucket-configuration/-suspending-bucket-configuration.html b/bucket4k/com.sletmoe.bucket4k/-suspending-bucket-configuration/-suspending-bucket-configuration.html index 25766db..3a217a1 100644 --- a/bucket4k/com.sletmoe.bucket4k/-suspending-bucket-configuration/-suspending-bucket-configuration.html +++ b/bucket4k/com.sletmoe.bucket4k/-suspending-bucket-configuration/-suspending-bucket-configuration.html @@ -1,10 +1,11 @@ - +
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
This method is deprecated, you should use `addLimit { ... }`
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
Defines the configuration for creating a SuspendingBucket.
Defines the configuration for creating a SuspendingBucket.
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
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.
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.
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
Adds a bandwidth limit to the bucket. See the Bucket4j documentation on Bandwidths for more information.
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.
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.
A type-safe builder for constructing SuspendingBucket objects.
A SuspendingBucket, constructed with the specified configuration.
A function literal with receiver, used for specifying SuspendingBucket configuration.
A type-safe builder for constructing SuspendingBucket objects.
A SuspendingBucket, constructed with the specified configuration.
A function literal with receiver, used for specifying SuspendingBucket configuration.
A type-safe builder for constructing SuspendingBucket objects.
A type-safe builder for constructing SuspendingBucket objects.
Adds the specified number of tokensToAdd to the bucket, not exceeding the capacity of the bucket. Delegates directly to the underlying LockFreeBucket's addTokens implementation.
The number of tokens to add to the bucket.
Adds the specified number of tokensToAdd to the bucket, not exceeding the capacity of the bucket. Delegates directly to the underlying LockFreeBucket's addTokens implementation.
The number of tokens to add to the bucket.
Returns the number of currently available tokens. Delegates directly to the underlying LockFreeBucket's getAvailableTokens implementation.
Returns the number of currently available tokens. Delegates directly to the underlying LockFreeBucket's getAvailableTokens implementation.
Returns the Bucket4j BucketConfiguration of the underlying LockFreeBucket. Delegates directly to the underlying LockFreeBucket's getConfiguration implementation.
Returns the Bucket4j BucketConfiguration of the underlying LockFreeBucket. Delegates directly to the underlying LockFreeBucket's getConfiguration implementation.
Adds the specified number of tokensToAdd to the bucket, even if it would result in the bucket containing more than its specified capacity. Delegates directly to the underlying LockFreeBucket's forceAddTokens implementation.
The number of tokens to add to the bucket.
Adds the specified number of tokensToAdd to the bucket, even if it would result in the bucket containing more than its specified capacity. Delegates directly to the underlying LockFreeBucket's forceAddTokens implementation.
The number of tokens to add to the bucket.
SuspendingBucket is an opaque wrapper around Bucket4j's LockFreeBucket, and implements an interface semantically equivalent to BlockingBucket. Whereas Bucket4j's blocking behavior is just that, SuspendingBucket instead delays, making it safe to use in a coroutine context.
Returns the number of currently available tokens. Delegates directly to the underlying LockFreeBucket's getAvailableTokens implementation.
Returns the Bucket4j BucketConfiguration of the underlying LockFreeBucket. Delegates directly to the underlying LockFreeBucket's getConfiguration implementation.
Adds the specified number of tokensToAdd to the bucket, not exceeding the capacity of the bucket. Delegates directly to the underlying LockFreeBucket's addTokens implementation.
Adds the specified number of tokensToAdd to the bucket, not exceeding the capacity of the bucket. Delegates directly to the underlying LockFreeBucket's addTokens implementation.
Adds the specified number of tokensToAdd to the bucket, even if it would result in the bucket containing more than its specified capacity. Delegates directly to the underlying LockFreeBucket's forceAddTokens implementation.
Adds the specified number of tokensToAdd to the bucket, even if it would result in the bucket containing more than its specified capacity. Delegates directly to the underlying LockFreeBucket's forceAddTokens implementation.
Replaces the bucket's configuration. This delegates directly to the underlying LockFreeBucket's replaceConfiguration implementation.
Replaces the bucket's configuration. This delegates directly to the underlying LockFreeBucket's replaceConfiguration implementation.
Tries to consume the specified number of tokensToConsume. Delegates directly to the underlying LockFreeBucket's tryConsume implementation.
Tries to consume the specified number of tokensToConsume, suspending up to maxWaitTime if necessary in order to accumulate enough tokens to consume the specified amount.
Returns the number of currently available tokens. Delegates directly to the underlying LockFreeBucket's getAvailableTokens implementation.
Returns the Bucket4j BucketConfiguration of the underlying LockFreeBucket. Delegates directly to the underlying LockFreeBucket's getConfiguration implementation.
Tries to consume the specified number of tokensToConsume. Delegates directly to the underlying LockFreeBucket's tryConsume implementation.
Tries to consume the specified number of tokensToConsume, suspending up to maxWaitTime if necessary in order to accumulate enough tokens to consume the specified amount.
Replaces the bucket's configuration. This delegates directly to the underlying LockFreeBucket's replaceConfiguration implementation.
The inheritance strategy is complex enough that I'm not going to summarize the algorithm here, see Bucket4j's documentation for more information.
The new BucketConfiguration to use.
Configuration for the strategy to use for token inheritance.
Replaces the bucket's configuration. This delegates directly to the underlying LockFreeBucket's replaceConfiguration implementation.
The inheritance strategy is complex enough that I'm not going to summarize the algorithm here, see Bucket4j's documentation for more information.
The new BucketConfiguration to use.
Configuration for the strategy to use for token inheritance.
Tries to consume the specified number of tokensToConsume. Delegates directly to the underlying LockFreeBucket's tryConsume implementation.
true if the tokens were consumed, false otherwise.
The number of tokens to try and consume from the bucket. Must be a positive value.
Tries to consume the specified number of tokensToConsume, suspending up to maxWaitTime if necessary in order to accumulate enough tokens to consume the specified amount.
The (slightly simplified) logic is as follows:
if tokensToConsume tokens are available, consume them and return true immediately
else if enough tokens will be made available to satisfy tokensToConsume within maxWaitTime, the function will delay until the requisite number of tokens are available, consume them, and return true.
else, will immediately return false.
It should also be noted that this function is fair: If invoked twice without enough tokens for the first request to succeed, the first request will be serviced before subsequent requests.
This algorithm is a direct copy of Bucket4j BlockingBucket's tryConsume, except it suspends the calling coroutine's execution while waiting for available tokens, rather than blocking the thread. See the Bucket4j tryConsume documentation for more details.
true if the tokens were consumed, false otherwise.
The number of tokens to try and consume from the bucket. Must be a positive value.
The maximum amount of time to wait for the bucket to refill enough tokens such that the requested tokensToConsume can be consumed.
Tries to consume the specified number of tokensToConsume. Delegates directly to the underlying LockFreeBucket's tryConsume implementation.
true if the tokens were consumed, false otherwise.
The number of tokens to try and consume from the bucket. Must be a positive value.
Tries to consume the specified number of tokensToConsume, suspending up to maxWaitTime if necessary in order to accumulate enough tokens to consume the specified amount.
The (slightly simplified) logic is as follows:
if tokensToConsume tokens are available, consume them and return true immediately
else if enough tokens will be made available to satisfy tokensToConsume within maxWaitTime, the function will delay until the requisite number of tokens are available, consume them, and return true.
else, will immediately return false.
It should also be noted that this function is fair: If invoked twice without enough tokens for the first request to succeed, the first request will be serviced before subsequent requests.
This algorithm is a direct copy of Bucket4j BlockingBucket's tryConsume, except it suspends the calling coroutine's execution while waiting for available tokens, rather than blocking the thread. See the Bucket4j tryConsume documentation for more details.
true if the tokens were consumed, false otherwise.
The number of tokens to try and consume from the bucket. Must be a positive value.
The maximum amount of time to wait for the bucket to refill enough tokens such that the requested tokensToConsume can be consumed.
Defines the configuration for creating a SuspendingBucket.
Defines the configuration for creating a SuspendingBucket.