switon / pool
Connection pooling and resource lifecycle management for Switon Framework
v1.0.0
2026-05-09 16:34 UTC
Requires
- php: >=8.3
- psr/event-dispatcher: ^1.0
- switon/core: ^1.0
- switon/event: ^1.0
- switon/sync: ^1.0
Requires (Dev)
- switon/testing: ^1.0
README
Connection pooling and borrowed-resource lifecycle management for Switon Framework.
Installation
composer require switon/pool
Requirements: PHP 8.3+
Quick Start
use Switon\Core\Attribute\Autowired; use Switon\Pooling\PoolManagerInterface; final class DemoConnection { public function ping(): string { return 'pong'; } } final class DemoService { #[Autowired] protected PoolManagerInterface $poolManager; public function ping(): string { $conn = $this->poolManager->guard($this, timeout: 1.0); return $conn->ping(); } }
Docs: https://docs.switon.dev/latest/pool
License
MIT.