Example #1
0
func (this *poolInfo) newPool() (pool.Pool, error) {
	p, err := pool.NewBlockingPool(this.minConns, this.maxConns, this.makeConn)
	if err != nil {
		return nil, err
	}
	return p, nil
}
Example #2
0
func newStorageClient(host string, port int) (*storageClient, error) {
	client := &storageClient{host: host, port: port}
	p, err := pool.NewBlockingPool(STORAGE_MIN_CONN, STORAGE_MAX_CONN, STORAGE_MAX_IDLE, client.makeConn)
	if err != nil {
		return nil, err
	}
	client.Pool = p
	return client, nil

}
Example #3
0
//cat_sender_init is internally used and only called by Cat_init_if.
func cat_sender_init() {
	sender_transaction_channel = make(chan Message, 1<<10)
	sender_max_batch_size = 1 << 8
	sender_pool, _ = pool.NewBlockingPool(1, 1, 90*time.Second, CONN_FACTORY)
	go sender_run()
}