Property | Type | Description | |
---|---|---|---|
$config | |||
$createFunction | |||
$failureCount | |||
$idlePool | SplQueue | ||
$poolSize | integer | 连接池的尺寸,最大连接数 | |
$resourceNum | |||
$resourcePool | array | idle connection | |
$taskQueue | SplQueue |
Method | Description | |
---|---|---|
__construct ( array $config = [], integer $poolSize = 100 ) | ||
create ( $callback ) | ||
failure ( ) | 失败计数 | |
getConfig ( ) : array | ||
join ( $resource ) | 加入到连接池中 | |
release ( $resource ) | 释放资源 | |
remove ( $resource ) : boolean | 移除资源 | |
request ( callable $callback ) : boolean | 请求资源 | |
setPoolSize ( $newSize ) | 修改连接池尺寸 |
Method | Description | |
---|---|---|
doTask ( ) |
public __construct ( array $config = [], integer $poolSize = 100 ) | ||
$config | array | |
$poolSize | integer |