From 08eba888fe510896f1863be6f2b5a72a91616975 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 7 Jan 2026 11:26:48 +0000 Subject: Add DomainThrottle for per-domain rate limiting Implement per-domain throttling for purgatory sync operations: - Concurrent request limit (max in-flight requests per domain) - Rate limit (max requests per minute via sliding window) - Fair round-robin queue processing across identifiers - In-progress tracking to prevent duplicate fetches - Tried URL tracking per identifier Add indexmap dependency for ordered iteration in round-robin queue. Includes 6 unit tests covering: - Concurrent limit enforcement - Rate limit enforcement (sliding window) - Round-robin fair processing - In-progress identifier skipping - Round-robin index adjustment on removal - Tried URL merging on re-enqueue --- src/purgatory/sync/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/purgatory/sync/mod.rs') diff --git a/src/purgatory/sync/mod.rs b/src/purgatory/sync/mod.rs index 7b6d64a..3c0d875 100644 --- a/src/purgatory/sync/mod.rs +++ b/src/purgatory/sync/mod.rs @@ -7,5 +7,7 @@ //! - Debouncing for burst event arrivals mod queue; +mod throttle; pub use queue::SyncQueueEntry; +pub use throttle::DomainThrottle; -- cgit v1.2.3