Skip to content

feat: retry with backoff and sliding-window rate limiter - #565

Closed
ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:retry-ratelimiter
Closed

ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:retry-ratelimiter

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Implements retry with exponential backoff and sliding-window rate limiting.

Changes

Retry with Backoff (#550)

  • withRetry() utility with configurable maxRetries, baseDelay, maxDelay, backoffMultiplier
  • CircuitBreaker class with CLOSED → OPEN → HALF_OPEN state machine
  • Automatic reset after timeout

Sliding-Window Rate Limiter (#551)

  • SlidingWindowRateLimiter scoped per tenant/API key
  • Tracks timestamps in a sliding window
  • Supports isAllowed(), getRemaining(), reset(), cleanup()

Testing

  • 11 tests covering retry logic, circuit breaker, and rate limiting

Closes #550, #551

- withRetry() utility with exponential backoff
- CircuitBreaker class (CLOSED → OPEN → HALF_OPEN)
- SlidingWindowRateLimiter scoped per tenant/API key
- 11 tests covering retry logic and rate limiting

Closes StableRoute-Org#550, StableRoute-Org#551
@ZacLou

ZacLou commented Sep 27, 2026

Copy link
Copy Markdown
Author

Closing this to keep the queue tidy.

@ZacLou ZacLou closed this Sep 27, 2026
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.

retry with backoff and a circuit breaker for the price oracle calls

1 participant