Skip to main content

Module pool

Module pool 

Source
Expand description

Connection pool — LIFO ordering, fail-fast acquire, no timeouts.

The pool maintains a stack of idle connections. acquire() pops the top (most recently used = warmest caches). On drop, the guard pushes the connection back. If the pool is exhausted, acquire() returns an error immediately — no blocking, no waiting.

§Singleflight

When multiple tasks need a new connection simultaneously, only one TCP connect is initiated per slot. Other tasks wait on a Notify and receive an error if the connect fails.

Structs§

Pool
A connection pool with LIFO ordering and fail-fast semantics.
PoolBuilder
Builder for configuring a connection pool.
PoolGuard
A borrowed connection from the pool. Returns to the pool on drop.
PoolStatus
Pool status metrics.
Transaction
A database transaction. Sends ROLLBACK on drop if not committed.