Versions in this module Expand all Collapse all v1 v1.0.0 Apr 18, 2022 Changes in this version + var ErrGetTimeout = errors.New("no item to get") + var ErrIdleFull = errors.New("idle items are full") + var ErrIdleTimeout = errors.New("the item is idle timeout") + var ErrPoolClosed = errors.New("the pool is closed") + type Creator interface + Close func() error + InitItem func(item PoolItem, n uint64) error + NewItem func() (PoolItem, error) + type Pool struct + func NewPool(name string, creator Creator, maxTotalNum int, maxIdleNum int, idleTimeout int) *Pool + func (self *Pool) ClearItem(item PoolItem) + func (self *Pool) Close() + func (self *Pool) Closed() bool + func (self *Pool) Get() (_item PoolItem, _err error) + func (self *Pool) GetIdleNum() int + func (self *Pool) GetName() string + func (self *Pool) GetTotalNum() int + func (self *Pool) GiveBack(item PoolItem) + func (self *Pool) IsItemActive(_item PoolItem) bool + func (self *Pool) SetGetTimeout(timeout int) + type PoolItem interface + Close func() error + GetContainer func() PoolItem + GetErr func() error + SetContainer func(PoolItem) + SetErr func(error)