func NewActivePool(queryTimeout, idleTimeout time.Duration) *ActivePool { return &ActivePool{ pool: pools.NewNumbered(), timeout: int64(queryTimeout), connPool: NewConnectionPool(1, idleTimeout), ticks: timer.NewTimer(idleTimeout / 10), } }
func NewActiveTxPool(timeout time.Duration) *ActiveTxPool { return &ActiveTxPool{ pool: pools.NewNumbered(), lastId: time.Now().UnixNano(), timeout: int64(timeout), ticks: timer.NewTimer(timeout / 10), txStats: stats.NewTimings("Transactions"), } }
func NewReservedPool() *ReservedPool { return &ReservedPool{pool: pools.NewNumbered(), lastId: 1} }
func (self *ActivePool) Close() { self.ticks.Close() self.connPool.Close() self.pool = pools.NewNumbered() }