diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 11:33:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 11:33:03 +0000 |
| commit | 09d9771acaffdc6e798cc32d2a68e6d46a323d3a (patch) | |
| tree | c580f49311e81a9348e7b08d761708b93226b388 /src/purgatory/sync/mod.rs | |
| parent | 08eba888fe510896f1863be6f2b5a72a91616975 (diff) | |
Add ThrottleManager for cross-domain rate limiting
Implements ThrottleManager which manages all per-domain DomainThrottle
instances and provides:
- Throttle status checking via is_throttled() for sync URL selection
- Request tracking via start_request()/complete_request()
- Identifier queue management via enqueue_identifier()
- Automatic domain throttle creation on first access
- Thread-safe access via DashMap with Mutex-wrapped throttles
The manager uses the configured max_concurrent and max_per_minute limits
for all domains. Trigger-based queue processing (set_context,
process_queued_identifier) will be added after SyncContext is available.
Tests verify:
- is_throttled reflects domain capacity correctly
- enqueue_identifier creates domain throttle if needed
- start_request creates domain throttle if needed
Diffstat (limited to 'src/purgatory/sync/mod.rs')
| -rw-r--r-- | src/purgatory/sync/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/purgatory/sync/mod.rs b/src/purgatory/sync/mod.rs index 3c0d875..b29f10e 100644 --- a/src/purgatory/sync/mod.rs +++ b/src/purgatory/sync/mod.rs | |||
| @@ -10,4 +10,4 @@ mod queue; | |||
| 10 | mod throttle; | 10 | mod throttle; |
| 11 | 11 | ||
| 12 | pub use queue::SyncQueueEntry; | 12 | pub use queue::SyncQueueEntry; |
| 13 | pub use throttle::DomainThrottle; | 13 | pub use throttle::{DomainThrottle, ThrottleManager}; |