-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add WithRetryHandler
for a custom RetryPolicy
#427
Comments
So, I have no tests and all, but this is working for my use case: |
Nice idea, pull requests are welcome! "handler" is probably a bit misleading here, because it suggests that this function handles retry, but it instead decides whether to perform a retry. Maybe something simpler like WithRetryFunc would fit better. |
@acouvreur I've included a simple test and some docs on top of your commit and @gavv 's suggestion to rename the function (with your co-author on the commit ofc, I hope you don't mind) |
Looks great! Thanks! |
@rafiramadhana Sure, thanks. I agree with the comment about the test, but didn't have a chance to look at the PR closely yet. |
Context:
My test is as simple as:
I'm expecting a dynamic result from one call to the other. And I'd like to handle the retry policy myself here. Whuch does not seems doable right now.
So something like:
What do you think ?
The text was updated successfully, but these errors were encountered: