Add Retry.forever() and ExponentialRetry.forever() classmethods#373
Merged
chrisguidry merged 4 commits intomainfrom Mar 26, 2026
Merged
Add Retry.forever() and ExponentialRetry.forever() classmethods#373chrisguidry merged 4 commits intomainfrom
chrisguidry merged 4 commits intomainfrom
Conversation
`Retry(attempts=None)` works but reads like "no value" rather than "keep going". `Retry.forever()` and `ExponentialRetry.forever()` are factory classmethods that say what they mean — they just return instances with `attempts=None` internally, so existing code is unaffected. Also updated the chaos suite (which was using `Retry(attempts=sys.maxsize)` to avoid the `None` weirdness) and the docs to lead with the new API. Closes #359 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documentation build overview
Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
|
The `if outcome.exception:` guard was unreachable — the worker always passes an exception to handle_failure. Removed the branch instead of writing a contorted test to cover it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The worker always passes an exception to handle_failure, so make that contract explicit with an assert rather than silently accepting None. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The chaos suite can run against older installed versions of docket where Retry.forever() doesn't exist yet. We can switch this over in a future release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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(attempts=None)works but reads like "no value" rather than "keep going".Retry.forever()andExponentialRetry.forever()are factory classmethods thatsay what they mean — they just return instances with
attempts=Noneinternally,so existing code is unaffected.
Also updated the chaos suite (which was using
Retry(attempts=sys.maxsize)toavoid the
Noneweirdness) and the docs to lead with the new API.Closes #359
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com