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

Proposal: OnRetry hook #416

Closed
Blokje5 opened this issue Feb 15, 2021 · 1 comment · Fixed by #417
Closed

Proposal: OnRetry hook #416

Blokje5 opened this issue Feb 15, 2021 · 1 comment · Fixed by #417
Assignees
Labels
feature v2 For resty v2

Comments

@Blokje5
Copy link
Contributor

Blokje5 commented Feb 15, 2021

Currently the Retry interface of the Resty client supports a custom condition for when to retry and a custom callback to calculate the time between retries. What I am currently missing is an OnRetry hook to execute side effecting operations whenever a request is retried.

For example, I have a use case where I want to authenticate with an API after an access token has expired. One potential way to solve that with resty would be to authenticate with the API if the request returned a 403. While it is currently possible to achieve this with the resty.Backoff, it would be much cleaner to have an OnRetry hook.

@jeevatkm jeevatkm added feature v2 For resty v2 labels Mar 20, 2021
@jeevatkm jeevatkm added this to the v2.6.0 Milestone milestone Mar 20, 2021
@jeevatkm
Copy link
Member

@Blokje5 Thanks for your proposal. I agree it will be a helpful feature for Resty users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature v2 For resty v2
Development

Successfully merging a pull request may close this issue.

2 participants