class PoolManager

Properties

protected DatabasePool> $pools

The cached pool instances.

Methods

__construct(Container $container)

Create a pool manager.

pool(string $name)

Get or create a pool for the given connection name.

existing(string $name)

Get the open pool for the given connection name, without creating one.

array
getPools()

Get the existing pools keyed by their physical connection names.

string
getPoolName(string $name)

Resolve the physical pool name for a requested connection name.

bool
has(string $name)

Check if a pool exists for the given connection name.

void
purge(string $name)

Remove a pool and close its connections.

string
getExistingPoolName(string $name)

Resolve an existing pool key for a requested connection name.

void
purgeForConnection(string $name)

Remove every pool for a configured connection.

void
purgeAll()

Remove all pools and close their connections.

Details

at line 26
__construct(Container $container)

Create a pool manager.

Parameters

Container $container

at line 34
DatabasePool pool(string $name)

Get or create a pool for the given connection name.

Parameters

string $name

Return Value

DatabasePool

at line 87
DatabasePool|null existing(string $name)

Get the open pool for the given connection name, without creating one.

Parameters

string $name

Return Value

DatabasePool|null

at line 103
array getPools()

Get the existing pools keyed by their physical connection names.

Return Value

array

at line 111
protected string getPoolName(string $name)

Resolve the physical pool name for a requested connection name.

Parameters

string $name

Return Value

string

at line 142
bool has(string $name)

Check if a pool exists for the given connection name.

Parameters

string $name

Return Value

bool

at line 153
void purge(string $name)

Remove a pool and close its connections.

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

Parameters

string $name

Return Value

void

at line 168
protected string getExistingPoolName(string $name)

Resolve an existing pool key for a requested connection name.

Parameters

string $name

Return Value

string

at line 181
void purgeForConnection(string $name)

Remove every pool for a configured connection.

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

Parameters

string $name

Return Value

void

at line 203
void purgeAll()

Remove all pools and close their connections.

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

Return Value

void