Skip to main content

Module pool

Module pool 

Source
Expand description

§Connection Pooling

Generic connection pool for all transport types.

This module provides a thread-safe, async-aware connection pooling mechanism that eliminates expensive TLS handshakes for repeated connections to the same endpoint. Essential for database and RPC scenarios where clients make many short-lived requests.

§Features

  • Generic over any transport type T
  • Configurable pool size (min/max connections)
  • TTL-based connection expiration
  • Health checks with automatic eviction
  • FIFO acquisition with LRU eviction on overflow
  • Thread-safe async operations

Structs§

ConnectionPool
Generic connection pool for any transport type
PoolConfig
Configuration for connection pooling
PoolMetrics
Pool metrics for monitoring and capacity planning
PooledConnectionGuard
RAII guard for pooled connections

Traits§

ConnectionFactory
Factory trait for creating new connections