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

25.x is outdated, please check the latest version 26.x


Latest version: pecl install openswoole-26.2.0

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 February 28, 2026