Skip to content

Add ExponentialBackoff - #102

Merged
pior merged 5 commits into
pior/v1.2/shared-on-errorfrom
pior/v1.2/exponential-backoff
Oct 6, 2026
Merged

pior merged 5 commits into
pior/v1.2/shared-on-errorfrom
pior/v1.2/exponential-backoff

Conversation

@pior

@pior pior commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

ExponentialBackoff(base, maxDelay) returns a backoff for ErrorBackoff: base, 2·base, 4·base, … capped at maxDelay. No jitter.

runnable.Retry(job, runnable.ErrorBackoff(runnable.ExponentialBackoff(time.Second, time.Minute)))
  • Doubling stops at the cap, so a large error count cannot overflow.
  • If maxDelay is below base, every delay is maxDelay.
  • The default backoff is unchanged.

@pior
pior added this pull request to stack #104 October 6, 2026 19:41
@pior
pior merged commit a06ce88 into main Oct 6, 2026
2 checks passed
@pior
pior deleted the pior/v1.2/exponential-backoff branch October 6, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant