Skip to content

feat: add WithRetry middleware with ConstantBackoff and ExponentialBa…#15

Merged
Raezil merged 1 commit into
mainfrom
feat/retry-middleware
May 21, 2026
Merged

feat: add WithRetry middleware with ConstantBackoff and ExponentialBa…#15
Raezil merged 1 commit into
mainfrom
feat/retry-middleware

Conversation

@Raezil
Copy link
Copy Markdown
Member

@Raezil Raezil commented May 21, 2026

…ckoff

WithRetry(n, backoff) re-invokes a handler up to n times on error (total attempts = n+1). Stops early on success, respects context cancellation during backoff sleep, and pairs naturally with the DLQ — after all retries are exhausted the error propagates to execute() and the event is dead-lettered as normal.

Backoff helpers: ConstantBackoff(d) always waits d; ExponentialBackoff(base) doubles on each retry (base, 2×base, 4×base, ...).

…ckoff

WithRetry(n, backoff) re-invokes a handler up to n times on error
(total attempts = n+1). Stops early on success, respects context
cancellation during backoff sleep, and pairs naturally with the DLQ —
after all retries are exhausted the error propagates to execute() and
the event is dead-lettered as normal.

Backoff helpers: ConstantBackoff(d) always waits d; ExponentialBackoff(base)
doubles on each retry (base, 2×base, 4×base, ...).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Raezil Raezil merged commit 15b1611 into main May 21, 2026
1 check passed
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