Registry / database / open-smf-connection-pool

open-smf-connection-pool

JSON →
library2.0.0phppackagistunverified

A common connection pool based on Swoole is usually used as the database connection pool.

composer require open-smf/connection-pool
INSTALL
IMPORT
SIG · OPEN-SMF-CONNECTIO
O
open-smf-connection-pool
databasephpv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ConnectionPool
use Smf\ConnectionPool\ConnectionPool;

Initialize a connection pool and borrow a PDO connection.

use Smf\ConnectionPool\ConnectionPool; use Smf\ConnectionPool\Connectors\PDOConnector; $pool = new ConnectionPool( [ 'minActive' => 5, 'maxActive' => 20, 'maxWaitTime' => 5, ], new PDOConnector(), [ 'dsn' => 'mysql:host=localhost;dbname=test', 'username' => 'root', 'password' => '', ] ); $pool->init(); $connection = $pool->borrow(); // Use $connection... $pool->return($connection);
Debug
Known issues
breakingRequires Swoole extension installed and enabled.
fix
Install Swoole via pecl install swoole or compile from source.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
open-smf-connection-pool — pip install open-smf-connection-pool · libregistry