class PoolFactory

Factory for creating and caching database connection pools.

Properties

protected DbPool> $pools

The cached pool instances.

Methods

__construct(Container $container)

No description

getPool(string $name)

Get or create a pool for the given connection name.

string
getPoolName(string $name)

Resolve the physical pool name for a requested connection name.

bool
hasPool(string $name)

Check if a pool exists for the given connection name.

void
flushPool(string $name)

Flush a specific pool, closing all connections.

string
getExistingPoolName(string $name)

Resolve an existing pool key for a requested connection name.

void
flushPoolsForConnection(string $name)

Flush all pool variants for a configured connection.

void
flushAll()

Flush all pools, closing all connections.

Details

at line 23
__construct(Container $container)

No description

Parameters

Container $container

at line 31
DbPool getPool(string $name)

Get or create a pool for the given connection name.

Parameters

string $name

Return Value

DbPool

at line 51
protected string getPoolName(string $name)

Resolve the physical pool name for a requested connection name.

Parameters

string $name

Return Value

string

at line 80
bool hasPool(string $name)

Check if a pool exists for the given connection name.

Parameters

string $name

Return Value

bool

at line 91
void flushPool(string $name)

Flush a specific pool, closing all connections.

Boot or tests only. Closes a worker-shared pool; connections already checked out by concurrent coroutines are destroyed on release.

Parameters

string $name

Return Value

void

at line 105
protected string getExistingPoolName(string $name)

Resolve an existing pool key for a requested connection name.

Parameters

string $name

Return Value

string

at line 118
void flushPoolsForConnection(string $name)

Flush all pool variants for a configured connection.

Boot or tests only. This closes shared worker pools and affects every coroutine that later resolves the same configured connection.

Parameters

string $name

Return Value

void

at line 135
void flushAll()

Flush all pools, closing all connections.

Boot or tests only. Closes every worker-shared pool; connections already checked out by concurrent coroutines are destroyed on release.

Return Value

void