pyrate_limiter.limit_context_decorator module#
- class pyrate_limiter.limit_context_decorator.LimitContextDecorator(limiter, *identities, delay=False, max_delay=None)#
Bases:
object
A class that can be used as a:
decorator
async decorator
contextmanager
async contextmanager
Intended to be used via
Limiter.ratelimit()
. Depending on arguments, calls that exceed the rate limit will either raise an exception, or sleep until space is available in the bucket.- Parameters
- async async_delayed_acquire()#
Delay and retry until we can successfully acquire an available bucket item
- delay_or_reraise(err)#
Determine if we should delay after exceeding a rate limit. If so, return the delay time, otherwise re-raise the exception.
- Return type
- delayed_acquire()#
Delay and retry until we can successfully acquire an available bucket item