Versions in this module Expand all Collapse all v1 v1.0.2 Apr 22, 2025 v1.0.1 Apr 22, 2025 v1.0.0 Apr 22, 2025 Changes in this version type Stats + WaitingMax int v0 v0.2.0 Apr 16, 2025 Changes in this version type Config + IdleTimeout time.Duration + func (c *Config[T]) Check() error v0.1.0 Apr 16, 2025 Changes in this version + var ErrNew = errors.New("failed to make new pool object") + var ErrStoppingOrStopped = errors.New("pool is stopping or stopped") + type Config struct + CheckFunc func(T) error + DestroyFunc func(T) + IdleTime time.Duration + Max int + Min int + NewFunc func() (T, error) + type Pool struct + func New[T any](config Config[T]) (*Pool[T], error) + func (p *Pool[T]) Get(ctx context.Context) (T, error) + func (p *Pool[T]) Put(object T) + func (p *Pool[T]) Start() error + func (p *Pool[T]) Stats() Stats + func (p *Pool[T]) Stop() + type Stats struct + BusyNow int + CountNow int + CreatedTotal uint + DestroyedTotal uint + IdleNow int + WaitedTotal uint + WaitingNow int