Releases: tinkermonkey/reference-api-buddy
Releases · tinkermonkey/reference-api-buddy
v0.5.0 - Fine-grained Rate Limiting & Request Deduplication
Immutable
release. Only release title and notes can be modified.
Added
- Fine-grained rate limiting: Per-second and per-minute rate limits for domain-specific throttling
- Configure
max_requests_per_secondandmax_requests_per_minutein domain mappings - Automatic request throttling with configurable delay tolerance
- Multi-window priority system (second → minute → hour)
- Sliding window implementation for accurate rate limiting
- Backward compatible with existing hour-level throttling
- Configure
- Request deduplication: Automatic coalescing of concurrent requests to the same resource
InFlightTrackerclass for tracking in-flight upstream requests- Thread-safe coordination using threading events
- Prevents duplicate upstream API calls during request bursts
- Error propagation and timeout handling for waiting requests
- Automatic cleanup of completed requests
- Statistics reporting via
get_stats()
- Comprehensive test coverage with 8 new tests for request deduplication and 9 tests for rate limiting
- Configuration validation for new rate limiting parameters
Changed
ThrottleManagernow acceptsdomain_mappingsparameter to extract per-minute/per-second limitsThrottleManagerextendsThrottleStateto track minute and second-level request windows- Request handler flow modified to use
get_required_delay()instead ofshould_throttle() - Proxy now sleeps automatically to stay within rate limits rather than rejecting requests with 429
- Only returns 429 when required delay exceeds
progressive_max_delay(default 300 seconds) - Request handler wraps upstream forwarding with deduplication logic
- Updated existing tests to work with new
get_required_delay()method
Fixed
- Prevents burst requests to upstream APIs when multiple clients request the same resource simultaneously
- Eliminates race conditions during concurrent cache misses for identical resources
Performance
- Significant reduction in duplicate upstream API calls during request bursts
- Faster response times for waiting requests (share result instead of making duplicate calls)
- Better upstream API utilization with automatic rate smoothing
- Deduplicated requests do NOT count against rate limits - only the first upstream request is rate-limited
Release v0.4.3
Immutable
release. Only release title and notes can be modified.
Bug fix for gzip handling for some wikidata requests
Release v0.4.2
Immutable
release. Only release title and notes can be modified.
Initial public release