proxywhirl.rotator.base¶
Shared base class for ProxyWhirl and AsyncProxyWhirl.
This module provides common functionality between sync and async rotators, reducing code duplication and ensuring consistent behavior.
Classes¶
Shared logic for sync and async proxy rotators. |
Module Contents¶
- class proxywhirl.rotator.base.ProxyRotatorBase[source]¶
Shared logic for sync and async proxy rotators.
This base class provides common functionality for both ProxyWhirl and AsyncProxyWhirl, including: - Proxy dictionary conversion (credentials handling) - Circuit breaker state checking - Proxy selection with circuit breaker filtering - Common attribute initialization
- pool¶
Proxy pool instance
- strategy¶
Rotation strategy instance
- config¶
Configuration settings
- circuit_breakers¶
Circuit breaker instances per proxy
- retry_policy¶
Retry policy configuration
- retry_metrics¶
Retry metrics tracking
- get_circuit_breaker_states()[source]¶
Get circuit breaker states for all proxies.
- Returns:
Mapping of proxy IDs to their circuit breaker instances.
- Return type:
Note
Returns a copy to prevent external modification.
- get_retry_metrics()[source]¶
Get retry metrics.
- Returns:
RetryMetrics instance with current metrics
- Return type:
proxywhirl.retry.RetryMetrics