utils
validate_amount(rate_limiter, amount)
Validate the requested amount for acquire
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate_limiter
|
HasCapacity
|
the rate limiter i.e. SyncLeakyBucket or AsyncTokenBucket |
required |
amount
|
float
|
The amount of capacity to acquire |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the requested amount exceeds the bucket's capacity or is negative |