Conversation
Signed-off-by: Xuanwo <github@xuanwo.io>
poljar
reviewed
Apr 9, 2025
| /// | ||
| /// When a retry occurs, the provided function will be called with the error and the proposed backoff duration, allowing you to modify the final duration used. | ||
| /// | ||
| /// If the function returns `None`, it indicates that no further retries should be made, and the error will be returned regardless of the backoff duration provided by the input. |
There was a problem hiding this comment.
There isn't anything wrong with this decision, but this makes the when() method somewhat redundant, no?
I can decide with the adjust() method the following:
- If I should retry or not
- If I should use the default timeout from my backoff strategy or if I should override it.
While the when() method can only decide option 1.
This makes me lean towards merging this functionality into the when() method, but that introduces API breakage.
So I guess everything is fine, despite when() becoming slightly less useful.
Owner
Author
There was a problem hiding this comment.
Yes. Both of notify and when can be seen as a simple case of adjust. 😆
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retry-Afterheader in HTTP responses. #150Demo: