本文整理汇总了PHP中Pool::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Pool::__construct方法的具体用法?PHP Pool::__construct怎么用?PHP Pool::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pool
的用法示例。
在下文中一共展示了Pool::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param array $nodeUrls
* @param CacheInterface|null $cache
* @param LoggerInterface|null $log
*
* @throws ConnectException
*/
public function __construct(array $nodeUrls = array(), CacheInterface $cache = null, LoggerInterface $log = null)
{
if (!$cache) {
$cache = new MemoryCache();
}
$this->cache = $cache;
parent::__construct($nodeUrls, $log);
}
示例2: array
function __construct($config = array(), $poolSize = 100)
{
if (empty($config['host'])) {
throw new Swoole\Exception\InvalidParam("require redis host option.");
}
if (empty($config['port'])) {
$config = self::DEFAULT_PORT;
}
parent::__construct($config, $poolSize);
$this->create(array($this, 'connect'));
}
示例3:
function __construct($config, $maxConnection = 100)
{
if (empty($config['host'])) {
throw new Swoole\Exception\InvalidParam("require mysql host option.");
}
if (empty($config['port'])) {
$config['port'] = self::DEFAULT_PORT;
}
parent::__construct($config, $maxConnection);
$this->create(array($this, 'connect'));
}
示例4: __construct
/**
* Constructor
* @param array $config Config variables
* @param boolean $init
*/
public function __construct($config = [], $init = true)
{
parent::__construct($config, false);
$this->bound = new \PHPDaemon\Structures\ObjectStorage();
if (isset($this->config->listen)) {
$this->bindSockets($this->config->listen->value);
}
if ($init) {
$this->init();
}
}
示例5: __construct
public function __construct($size, $class = Worker::class, array $ctor = array())
{
$this->pipe = new Pipe();
$this->packet = new Volatile();
parent::__construct($size, $class, $ctor);
}
示例6: __construct
public function __construct($size, $class, array $ctor = [])
{
parent::__construct($size, $class, $ctor);
}
示例7: __construct
public function __construct(CommandBus $bus)
{
parent::__construct(5, CommandBusWorker::class, [$bus]);
}
示例8: __construct
/**
* @param string $path Cache directory path
* @param int $defaultTtl
*/
public function __construct($path, $defaultTtl = 0)
{
parent::__construct($defaultTtl);
$this->path;
}
示例9: __construct
public function __construct($workers = 4, $class = \Worker::class, $ctor = [])
{
parent::__construct($workers, $class, $ctor);
}