switon/pool

Connection pooling and resource lifecycle management for Switon Framework

Maintainers

Package info

github.com/switon-php/pool

Documentation

pkg:composer/switon/pool

Statistics

Installs: 38

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-09 16:34 UTC

This package is auto-updated.

Last update: 2026-05-09 16:34:30 UTC


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.