OpenSwoole\Core\Coroutine\Pool\ClientPool->__construct

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Core\Coroutine\Pool\ClientPool->__construct($factory, $config, int $size = self::DEFAULT_SIZE, bool $heartbeat = false)

Parameters

factory

A factory class to create a new connection, it could be MysqliClientFactory, PDOClientFactory or RedisClientFactory

config

The config data that the factory class needs to create a new instance.

size

This size of connection pool, default size is 16.

heartbeat

Enable heartbeat or not.

Return

Description

Create a new ClientPool with constructor function.

Last updated on September 22, 2022