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

Implement FIFO queue in http client #231

Open
DinoLeung opened this issue Feb 1, 2023 · 0 comments
Open

Implement FIFO queue in http client #231

DinoLeung opened this issue Feb 1, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request just a concept

Comments

@DinoLeung
Copy link
Owner

DinoLeung commented Feb 1, 2023

Is your feature request related to a problem?

Users have reported 429 errors happening frequently in roughly the same time frame(#226), root causes is still unknown but it's clear that teledart client is making too many requests and it's exceeding telegram bot api's burst-able rate (See https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this).

Describe the solution you'd like

Implement a FIFO queue and a rate limited consumer in http_client.dart. Each http request error need to be categorised as retry-able and not retry-able, see https://github.com/TelegramBotAPI/errors. The rate limiter and request queue needs to be global, http_client.dart needs to become a singleton as part of the solution. Some of the hacky retry logic can be taken out from long_polling.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request just a concept
Projects
None yet
Development

No branches or pull requests

1 participant