Exemplo n.º 1
0
func NewActivePool(queryTimeout, idleTimeout time.Duration) *ActivePool {
	return &ActivePool{
		pool:     pools.NewNumbered(),
		timeout:  int64(queryTimeout),
		connPool: NewConnectionPool(1, idleTimeout),
		ticks:    timer.NewTimer(idleTimeout / 10),
	}
}
Exemplo n.º 2
0
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"),
	}
}
Exemplo n.º 3
0
func NewReservedPool() *ReservedPool {
	return &ReservedPool{pool: pools.NewNumbered(), lastId: 1}
}
Exemplo n.º 4
0
func (self *ActivePool) Close() {
	self.ticks.Close()
	self.connPool.Close()
	self.pool = pools.NewNumbered()
}