admin 管理员组

文章数量: 1086019


2024年4月29日发(作者:hsck仓库最新域名)

if (!is_callable($this->factory)) {

throw new InvalidParamException('The "factory" property must be callable.');

}

$this->bootstrap();

}

/**

* bootstrap pool

*/

private function bootstrap()

{

$this->channel = new Channel($this->size);

for ($i = 0; $i < $this->size; $i++) {

$this->channel->push(call_user_func($this->factory));

}

}

/**

* Acquire a connection

* @param int $timeout

* @return mixed

*/

public function acquire($timeout = 0)

{

return $this->channel->pop($timeout);

}

/**

* Release a resource

* @param mixed $resource

*/

public function release($resource)

{

$this->channel->push($resource);

}

}


本文标签: 仓库 作者 域名