Documentation ¶ Index ¶ Constants type Item type Pool func NewPool[T any](ctx context.Context, maxSize int, idleTimeout time.Duration, ...) *Pool[T] func (p *Pool[T]) Close() func (p *Pool[T]) Get(ctx context.Context) (T, error) func (p *Pool[T]) Put(ctx context.Context, v T) error Constants ¶ View Source const DefaultPoolMaxSize = 16 Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Item ¶ type Item[T any] struct { // contains filtered or unexported fields } type Pool ¶ type Pool[T any] struct { // contains filtered or unexported fields } func NewPool ¶ func NewPool[T any](ctx context.Context, maxSize int, idleTimeout time.Duration, newFunc func(ctx context.Context) (T, error), closeFunc func(T)) *Pool[T] func (*Pool[T]) Close ¶ func (p *Pool[T]) Close() func (*Pool[T]) Get ¶ func (p *Pool[T]) Get(ctx context.Context) (T, error) func (*Pool[T]) Put ¶ func (p *Pool[T]) Put(ctx context.Context, v T) error Source Files ¶ View all Source files pool.go Click to show internal directories. Click to hide internal directories.