Module connection_multiplexing

Module connection_multiplexing 

Source
Expand description

Connection multiplexing for coordinator communication.

This module provides connection pooling and multiplexing capabilities for efficient HTTP communication with the coordinator. It reduces connection overhead by reusing existing connections and queuing requests.

§Features

  • Connection pooling with configurable size limits
  • Automatic connection health monitoring
  • Request queuing and fair scheduling
  • Exponential backoff retry logic
  • Connection keep-alive management
  • Circuit breaker integration for failed connections

§Example

use chie_core::connection_multiplexing::{ConnectionPool, PoolConfig};
use std::time::Duration;

// Configure connection pool
let config = PoolConfig::default()
    .with_max_connections(10)
    .with_idle_timeout(Duration::from_secs(60));

// Create pool
let pool = ConnectionPool::new("https://coordinator.example.com", config);

// Make requests through the pool
let response = pool.request("POST", "/api/proofs", b"proof_data").await?;

Structs§

ConnectionPool
HTTP connection pool with multiplexing support.
PoolConfig
Configuration for the connection pool.
PoolStats
Statistics for the connection pool.

Enums§

ConnectionError
Errors that can occur during connection pool operations.