aiohttp: rate limiting parallel requests
问题 APIs often have rate limits that users have to follow. As an example let's take 50 requests/second. Sequential requests take 0.5-1 second and thus are too slow to come close to that limit. Parallel requests with aiohttp, however, exceed the rate limit. To poll the API as fast as allowed, one needs to rate limit parallel calls. Examples that I found so far decorate session.get , approximately like so: session.get = rate_limited(max_calls_per_second)(session.get) This works well for sequential