Versions in this module Expand all Collapse all v1 v1.4.0 Apr 19, 2026 Changes in this version + var ErrPoolClosed = errors.New("celeris/async: pool is closed") + var ErrPoolExhausted = errors.New("celeris/async: pool exhausted") + type Backoff struct + Base time.Duration + Cap time.Duration + Jitter float64 + func NewBackoff(base, maxDelay time.Duration) *Backoff + func (b *Backoff) Attempts() int + func (b *Backoff) Next(attempt int) time.Duration + func (b *Backoff) Reset() + type Bridge struct + func NewBridge() *Bridge + func (b *Bridge) DrainWithError(err error, notify func(PendingRequest, error)) + func (b *Bridge) Enqueue(req PendingRequest) + func (b *Bridge) Head() PendingRequest + func (b *Bridge) Len() int + func (b *Bridge) Pop() PendingRequest + func (b *Bridge) PopTail() PendingRequest + type Conn interface + Close func() error + IsExpired func(now time.Time) bool + IsIdleTooLong func(now time.Time) bool + Ping func(ctx context.Context) error + Worker func() int + type PendingRequest interface + Ctx func() context.Context + type Pool struct + func NewPool[C Conn](cfg PoolConfig, dial func(ctx context.Context, workerID int) (C, error)) *Pool[C] + func (p *Pool[C]) Acquire(ctx context.Context, workerHint int) (C, error) + func (p *Pool[C]) Close() error + func (p *Pool[C]) Discard(c C) + func (p *Pool[C]) IdleConnWorkers() []int + func (p *Pool[C]) Release(c C) + func (p *Pool[C]) Stats() PoolStats + type PoolConfig struct + HealthCheck time.Duration + MaxIdlePerWorker int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpen int + NumWorkers int + type PoolStats struct + Idle int + InUse int + Open int + PerWorker []PoolWorkerStats + type PoolWorkerStats struct + Idle int