From 3b8a01160d2014498c0157c0e04e0523c5b68325 Mon Sep 17 00:00:00 2001 From: C <0xicl33n@gmail.com> Date: Sat, 11 Oct 2025 11:38:54 -0700 Subject: [PATCH] move throttler example. we dont need it in src --- src/{ => scripts}/throttler_example.py | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) rename src/{ => scripts}/throttler_example.py (96%) diff --git a/src/throttler_example.py b/src/scripts/throttler_example.py similarity index 96% rename from src/throttler_example.py rename to src/scripts/throttler_example.py index 70ba7e3..0a9756f 100644 --- a/src/throttler_example.py +++ b/src/scripts/throttler_example.py @@ -1,15 +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) +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)