Versions in this module Expand all Collapse all v0 v0.1.1 Nov 6, 2024 Changes in this version + var ErrPoolClosed = errors.New("pool is closed") + var ErrPoolFull = errors.New("pool is full") + type CappedPool struct + Closer func(V) + New func() V + func InitCappedPool[V any](p *CappedPool[V], cap int) *CappedPool[V] + func NewCappedPool[V any](cap int) *CappedPool[V] + func (p *CappedPool[V]) Close() + func (p *CappedPool[V]) Get(ctx context.Context) (v V, err error) + func (p *CappedPool[V]) Put(v V) error + type ConcurrencyPool struct + BlockInterval time.Duration + func InitConcurrencyPool[V any](p *CappedPool[V], cap int) *ConcurrencyPool[V] + func NewConcurrencyPool[V any](cap int) *ConcurrencyPool[V] + func (p *ConcurrencyPool[V]) Get(ctx context.Context) (v V, err error) + func (p *ConcurrencyPool[V]) Put(v V) error + func (p *ConcurrencyPool[V]) Release(v V) + type NilPool struct + Closer func(V) + New func() V + func (p *NilPool[V]) Close() + func (p *NilPool[V]) Get(_ context.Context) (v V, err error) + func (p *NilPool[V]) Put(v V) error + func (p *NilPool[V]) Release(v V) + type Pool interface + Close func() + Get func(context.Context) (V, error) + Put func(V) error + type WaitGroup struct + func (wg *WaitGroup) Add(delta int) + func (wg *WaitGroup) Done() + func (wg *WaitGroup) IsWaiting() bool + func (wg *WaitGroup) Reset() + type WaitPool interface + Release func(V)