Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: add an example for REST polling use case #3

Open
vincetran96 opened this issue Jun 19, 2021 · 0 comments
Open

Suggestion: add an example for REST polling use case #3

vincetran96 opened this issue Jun 19, 2021 · 0 comments

Comments

@vincetran96
Copy link

It may be helpful to add an example of using this package for REST polling (e.g., continuously fetching data from a REST API), because specifying a relatively long period (e.g., 60 seconds) can cause an unnecessary spike in the number of requests at the beginning of every period. Additionally, users of this package may likely be interested in this specific use case.

For instance, if I set throttler = Throttler(rate_limit=500, period=60), 500 requests would be made at the very beginning of the 60 seconds period, and then nothing would happen until the next 60 seconds mark. This resulted in a lot of 429 (too many requests) response codes. To get around this, I had to specify rate_limit as 1 and period as 60/500. Of course, the possibility of getting 429 responses also depend on the tolerance of the API server in question.

That said, I believe the above issue is worth considering, unless I am doing something wrong or do not know what I was doing. Anyways, thanks for maintaining this package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant