Versions in this module Expand all Collapse all v3 v3.80.13 Sep 25, 2024 v3.80.12 Sep 24, 2024 Changes in this version + const DefaultLimit + type Config struct + type Item interface + Close func(ctx context.Context) error + IsAlive func() bool + type ItemConstraint interface + type Option func(c *Config[PT, T]) + func WithClock[PT ItemConstraint[T], T any](clock clockwork.Clock) Option[PT, T] + func WithCloseItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T] + func WithCreateItemFunc[PT ItemConstraint[T], T any](f func(ctx context.Context) (PT, error)) Option[PT, T] + func WithCreateItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T] + func WithIdleTimeToLive[PT ItemConstraint[T], T any](idleTTL time.Duration) Option[PT, T] + func WithItemUsageLimit[PT ItemConstraint[T], T any](itemUsageLimit uint64) Option[PT, T] + func WithLimit[PT ItemConstraint[T], T any](size int) Option[PT, T] + func WithSyncCloseItem[PT ItemConstraint[T], T any]() Option[PT, T] + func WithTrace[PT ItemConstraint[T], T any](t *Trace) Option[PT, T] + type Pool struct + func New[PT ItemConstraint[T], T any](ctx context.Context, opts ...Option[PT, T]) *Pool[PT, T] + func (p *Pool[PT, T]) Close(ctx context.Context) (finalErr error) + func (p *Pool[PT, T]) Stats() Stats + func (p *Pool[PT, T]) With(ctx context.Context, f func(ctx context.Context, item PT) error, ...) (finalErr error) + type Stats struct + CreateInProgress int + Idle int + Index int + Limit int + Wait int + type Trace struct + OnChange func(Stats) + OnClose func(ctx *context.Context, call stack.Caller) func(err error) + OnGet func(ctx *context.Context, call stack.Caller) func(item any, attempts int, err error) + OnNew func(ctx *context.Context, call stack.Caller) func(limit int) + OnPut func(ctx *context.Context, call stack.Caller, item any) func(err error) + OnTry func(ctx *context.Context, call stack.Caller) func(err error) + OnWith func(ctx *context.Context, call stack.Caller) func(attempts int, err error)