imefisto/eventsauce-pdo-message-repository-swoole
Composer 安装命令:
composer require imefisto/eventsauce-pdo-message-repository-swoole
包简介
Swoole coroutine-aware connection pool for eventsauce-pdo-message-repository
README 文档
README
Swoole coroutine-aware connection pool for eventsauce-pdo-message-repository.
Installation
composer require imefisto/eventsauce-pdo-message-repository-swoole
Usage
SwooleConnectionManager is a drop-in replacement for DefaultConnectionManager:
use Imefisto\EventSaucePDOMessageRepository\Swoole\SwooleConnectionManager; $connection = new SwooleConnectionManager( dsn: 'mysql:host=127.0.0.1;dbname=mydb', user: 'user', password: 'password', maxSize: 10 ); $repo = new PDOMessageRepository($connection, $tableName, $serializer);
How it works
- Connections are created lazily up to
$maxSize - When all connections are checked out,
get()suspends the calling coroutine until one is returned — no busy-waiting, no connection leak - Coroutine context makes the pool safe: Swoole only yields at I/O / channel operations, so the connection count check and increment are atomic
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-30