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

Allow Operation function to return minimum interval to wait in backoff #134

Open
ItalyPaleAle opened this issue Jun 13, 2023 · 0 comments
Open

Comments

@ItalyPaleAle
Copy link
Contributor

Example: the function invoked by backoff makes HTTP requests, and the server responds with a 429 ("retry after") status code.

We want the Operation function to be able to return an error which indicates that the next backoff should not happen before the given delay.

For example, assume that the next backoff is in 1s, but the server responds with a "Retry-After" indicating a 5s delay. The handler should return a special kind of error (for example, MinBackoffError, similar to PermanentError) that indicates that the next attempt should not happen in less than 5s.

The backoff library will then pick the maximum of the 2 (1s and 5s) and use that as the next backoff.

I am happy to submit a PR if you think you would be interested in this!

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

No branches or pull requests

2 participants