move throttler example. we dont need it in src

This commit is contained in:
C committed 2025-10-26 15:47:59 -07:00
1 parent 0f60a31ef8
commit 3b8a01160d
1 file changed
+15 -15
+15
View File
@@ -0,0 +1,15 @@
import aiohttp
import asyncio
from asyncio_throttle.throttler import Throttler
throttler = Throttler(rate_limit=500, period=60) # 500 requests per minute
async def worker(throttler, session):
while True:
async with throttler:
async with session.get("http://example.com") as resp:
do_some_job_with(await resp.text())
await asyncio.sleep(0.05)