configs
Configuration for Rate Limiter implementations
BucketConfig
dataclass
Configuration for any Rate Limiter
Source code in limitor/configs.py
capacity = 10
class-attribute
instance-attribute
Maximum number of items the bucket can hold i.e. number of requests that can be processed at once
seconds = 1
class-attribute
instance-attribute
Up to capacity acquisitions are allowed within this time period in a burst
__post_init__()
Validate the configuration parameters
Capacity
Bases: NamedTuple
Information about the current capacity of the bucket
Source code in limitor/configs.py
has_capacity
instance-attribute
Indicates if the bucket has enough capacity to accommodate the requested amount
needed_capacity
instance-attribute
Amount of capacity needed to accommodate the request, if any