src/Connection/PoolTrait.php
public function initPool($config) {
		if (!method_exists($this, 'getMinClient') || !method_exists($this, 'getMaxClient')) {
			throw new NotFoundException("Method getMinClient or getMaxClient not found");
		}
		$this->wait = new SplQueue;
		$this->connection = new SplQueue;
		$this->last_run_out_time = time();
		if (isset($config['min'])) {
			$this->min_client = intval($config['min']);
		}
		if (isset($config['max'])) {
			$this->max_client = intval($config['max']);
		}
		//建立最小连接
		$count = $this->getMinClient();
		while ($count--) {
			$this->createConnection();
		}
	}
public function initPool($config) {
		if (!method_exists($this, 'getMinClient') || !method_exists($this, 'getMaxClient')) {
			throw new NotFoundException("Method getMinClient or getMaxClient not found");
		}
		$this->wait = new SplQueue;
		$this->connection = new SplQueue;
		$this->last_run_out_time = time();
		if (isset($config['min'])) {
			$this->min_client = intval($config['min']);
		}
		if (isset($config['max'])) {
			$this->max_client = intval($config['max']);
		}
		//建立最小连接
		$count = $this->getMinClient();
		while ($count--) {
			$this->createConnection();
		}
	}
public function initPool ( $ config ) { if ( ! method_exists ( $ this , 'getMinClient' ) || ! method_exists ( $ this , 'getMaxClient' ) ) { throw new NotFoundException ( "Method getMinClient or getMaxClient not found" ) ; } $ this -> wait = new SplQueue ; $ this -> connection = new SplQueue ; $ this -> last_run_out_time = time ( ) ; if ( isset ( $ config [ 'min' ] ) ) { $ this -> min_client = intval ( $ config [ 'min' ] ) ; } if ( isset ( $ config [ 'max' ] ) ) { $ this -> max_client = intval ( $ config [ 'max' ] ) ; } //建立最小连接 $ count = $ this -> getMinClient ( ) ; while ( $ count -- ) { $ this -> createConnection ( ) ; } }
Setup connection pool

@access public
@param array $config
Setup connection pool