aiolimiter
Introduction
An efficient implementation of a rate limiter for asyncio.
This project implements the Leaky bucket algorithm, giving you precise control over the rate a code section can be entered:
from aiolimiter import AsyncLimiter
rate_limit = AsyncLimiter(100, 30)
async def some_coroutine():
async with rate_limit:
await do_something()
It was first developed as an answer on Stack Overflow.
|