Skip to content

feat: add WithOnRateLimit callback option - #1

Merged
elliothllm merged 2 commits into
mainfrom
feat/on-rate-limit-callback
Feb 21, 2026
Merged

elliothllm merged 2 commits into
mainfrom
feat/on-rate-limit-callback

Conversation

@elliothllm

Copy link
Copy Markdown
Contributor

Summary

  • Adds WithOnRateLimit(fn func(RateLimitEvent)) option to the client
  • The callback fires on every 429 response, including retries that will succeed
  • RateLimitEvent includes method, path, attempt number, max retries, and retry delay
  • Passes method and path through doWithRetry to provide full context in the callback

Test plan

  • Existing tests pass (go test ./...)
  • Verify callback fires in miranda-webhook-dashboard with mock-inflow rate limiting

Adds an OnRateLimit callback that fires on every 429 response, including
retries that will succeed. This gives callers visibility into rate
limiting without waiting for all retries to be exhausted.
@elliothllm
elliothllm merged commit f653662 into main Feb 21, 2026
@elliothllm
elliothllm deleted the feat/on-rate-limit-callback branch February 21, 2026 16:23
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