-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
The API I am trying against has a limit of 250 requests per minute. Whatever I try I get 429 responses, it doesnt seep to "sleep" or "slow down" after 250 requests
async def main():
limiter = AsyncLimiter(250, 60)
async with client as cl: # httpx async client
# for i in range(400):
# async with limiter:
async with limiter:
for i in range(400):
await cl.get(url)
asyncio.run(main())Furthermore, the code I am trying to make use of your library has this form:
async def get_name():
# api request
...
async def get_last_name():
# another api request
...
async def get_user_data():
name = await get_name()
last_name = await get_last_name()
return name, last_name
async def main():
coros = [get_user_data() for user in many_users()]
for result in asyncio.gather(*coros):
# handle resultIs it possible somehow to apply the limiter in such structure?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested