Expand description
Per-host rate limiting and concurrency control Per-host rate limiting and concurrency control.
This module provides adaptive rate limiting for HTTP requests on a per-host basis. It prevents overwhelming servers with too many concurrent requests and respects server-provided rate limit headers.
§Architecture
- [
HostKey]: Represents a hostname/domain for rate limiting - [
Host]: Manages rate limiting, concurrency, and caching for a specific host - [
HostPool]: Coordinates multiple hosts and routes requests appropriately - [
HostConfig]: Configuration for per-host behavior - [
HostStats]: Statistics tracking for each host
Structs§
- Host
- Represents a single host with its own rate limiting, concurrency control, HTTP client configuration, and request cache.
- Host
Config - Configuration for a specific host’s rate limiting behavior
- HostKey
- A type-safe representation of a hostname for rate limiting purposes.
- Host
Pool - Manages a pool of Host instances and routes requests to appropriate hosts.
- Host
Stats - Record and report statistics for a
crate::ratelimit::Host - Host
Stats Map - A
HashMapmapping hosts to theirHostStats - Rate
Limit Config - Global rate limiting configuration that applies as defaults to all hosts
Type Aliases§
- Client
Map - Keep track of host-specific
reqwest::Clients - Host
Configs - Per-host configuration overrides