Module http_pool

Module http_pool 

Source
Expand description

HTTP connection pooling utilities.

This module provides connection pooling and client management for HTTP requests to the CHIE coordinator and other services. It includes retry logic, timeout handling, and connection reuse.

§Features

  • Connection Pooling: Reuse HTTP connections for better performance
  • Automatic Retries: Retry failed requests with exponential backoff
  • Timeout Handling: Configure request and connection timeouts
  • Rate Limiting: Per-endpoint rate limiting support
  • Circuit Breaker: Automatic failure detection and recovery

§Example

use chie_core::http_pool::{HttpClientPool, HttpConfig};

let config = HttpConfig::default();
let pool = HttpClientPool::new(config);

// Make a GET request
let response = pool.get("https://coordinator.chie.network/health").await?;
println!("Status: {}", response.status());

// Make a POST request with JSON body
let json = serde_json::json!({"key": "value"});
let response = pool.post_json("https://coordinator.chie.network/api", json).await?;

Structs§

HttpClientPool
HTTP client pool with connection reuse.
HttpConfig
HTTP client configuration.

Enums§

HttpError
HTTP client error types.