pub struct PoolBuilder { /* private fields */ }Expand description
Build a reusable pool. Clone the resulting pool to share rotation counters, health state, and per-node connection pools across tasks.
Implementations§
Source§impl PoolBuilder
impl PoolBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Start with per-request rotation, a 30s request timeout, and passive health feedback.
Sourcepub fn subscription(self, source: SubscriptionSource) -> Self
pub fn subscription(self, source: SubscriptionSource) -> Self
Add a subscription; repeated source URLs are deduplicated.
Sourcepub fn nodes(self, nodes: impl IntoIterator<Item = ProxyNode>) -> Self
pub fn nodes(self, nodes: impl IntoIterator<Item = ProxyNode>) -> Self
Add static nodes, optionally alongside subscriptions.
Sourcepub fn cache(self, policy: CachePolicy) -> Self
pub fn cache(self, policy: CachePolicy) -> Self
Enable private, atomic on-disk subscription caching. Disabled by default.
Sourcepub fn rotation(self, policy: RotationPolicy) -> Self
pub fn rotation(self, policy: RotationPolicy) -> Self
Configure request-count and/or time-based rotation.
Sourcepub fn health(self, policy: HealthPolicy) -> Self
pub fn health(self, policy: HealthPolicy) -> Self
Configure health probes and failure cooldowns.
Sourcepub fn subscription_client(self, client: Client) -> Self
pub fn subscription_client(self, client: Client) -> Self
Override the subscription HTTP client, for example to use a bootstrap proxy. Its headers, redirects, and TLS policy are controlled by the caller.
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Set the total timeout for each business request.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the connection timeout for each business client.
Sourcepub fn subscription_timeout(self, timeout: Duration) -> Self
pub fn subscription_timeout(self, timeout: Duration) -> Self
Bound the entire subscription download, including custom clients.
Sourcepub fn refresh_interval(self, interval: Duration) -> Self
pub fn refresh_interval(self, interval: Duration) -> Self
Background remote refresh frequency, independent of the disk cache TTL.
Sourcepub fn health_interval(self, interval: Duration) -> Self
pub fn health_interval(self, interval: Duration) -> Self
Background health check frequency.
Sourcepub fn max_subscription_bytes(self, bytes: usize) -> Self
pub fn max_subscription_bytes(self, bytes: usize) -> Self
Maximum response bytes accepted per subscription.
Sourcepub fn max_in_flight_per_proxy(self, limit: NonZeroUsize) -> Self
pub fn max_in_flight_per_proxy(self, limit: NonZeroUsize) -> Self
Bound business attempts per node. Saturated nodes are skipped; if all
healthy nodes are busy, acquisition returns Error::PoolSaturated.
Automatic execution releases its slot at response headers; a manual
lease can be held until its response body has been consumed.
Sourcepub fn subscription_concurrency(self, limit: NonZeroUsize) -> Self
pub fn subscription_concurrency(self, limit: NonZeroUsize) -> Self
Bound simultaneous subscription requests, preserving source order.