Пример #1
0
func newTrackerClient(host string, port int) (*trackerClient, error) {
	client := &trackerClient{host: host, port: port}
	p, err := pool.NewBlockingPool(TRACKER_MIN_CONN, TRACKER_MAX_CONN, TRACKER_MAX_IDLE, client.makeConn)
	if err != nil {
		return nil, err
	}
	client.Pool = p
	return client, nil
}
Пример #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

}
Пример #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()
}