- class pyrate_limiter.limiter.Limiter(*rates, bucket_class=<class 'pyrate_limiter.bucket.MemoryQueueBucket'>, bucket_kwargs=None, time_function=None)#
Main rate-limiter class
RequestRate) – Request rate definitions
- ratelimit(*identities, delay=False, max_delay=None)#
A decorator and contextmanager that applies rate-limiting, with async support. Depending on arguments, calls that exceed the rate limit will either raise an exception, or sleep until space is available in the bucket.
str) – One or more identities to acquire. Typically this is the name of a service or resource that is being rate-limited.
bool) – Delay until the next request instead of raising an exception
BucketFullException – If the rate limit is reached, and
delay=Falseor the delay exceeds
Attempt to acquire an item, or raise an error if a rate limit has been exceeded.