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 --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index e1e1627..eceebcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,9 @@ prometheus = "0.13" dashmap = "5" lazy_static = "1.4" +# Data structures +indexmap = "2" + # Random (for startup jitter) rand = "0.8" -- cgit v1.2.3