Versions in this module Expand all Collapse all v0 v0.1.0 Aug 18, 2026 Changes in this version + var ErrPoolClosed = errors.New("pool: closed") + type ConnConfig struct + HealthCheck func(any) error + HealthPeriod time.Duration + MaxIdle int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpen int + type ConnPool struct + func NewConnPool[T any](factory Factory[T], destroyer Destroyer[T], cfg ConnConfig) *ConnPool[T] + func (p *ConnPool[T]) Close() + func (p *ConnPool[T]) Get() (T, error) + func (p *ConnPool[T]) Put(x T) + func (p *ConnPool[T]) Stats() PoolStats + type Destroyer func(x T) + type Factory func() (T, error) + type ObjectPool struct + func NewObjectPool[T any](factory Factory[T], maxOpen int, destroyer Destroyer[T]) *ObjectPool[T] + func (p *ObjectPool[T]) Close() + func (p *ObjectPool[T]) Get() (T, error) + func (p *ObjectPool[T]) Put(x T) + func (p *ObjectPool[T]) Stats() PoolStats + type PoolStats struct + IdleCount int + InUse int32 + OpenCount int32 + type WorkerPool struct + func NewWorkerPool(workers int, queueSize int) *WorkerPool + func (p *WorkerPool) Start() + func (p *WorkerPool) Stats() WorkerStats + func (p *WorkerPool) Stop() + func (p *WorkerPool) Submit(task func()) error + type WorkerStats struct + Completed int64 + Failed int64 + Pending int + Submitted int64 + Workers int