interface ConnectionPool

Methods

string
getName()

Get the pool name.

borrow()

Borrow a connection from the pool.

void
release(Connection $connection)

Release a connection back to the connection pool.

void
discard(Connection $connection)

Discard a borrowed connection from the connection pool.

void
trimExcessIdle()

Close excess idle connections without checking their age.

void
close()

Close the connection pool and release its resources.

bool
isClosed()

Determine if the connection pool is closed.

getOptions()

Get the pool configuration options.

int
getManagedCount()

Return the number of connections managed by the pool.

int
getBorrowedCount()

Return the number of connections borrowed by callers.

int
getIdleCount()

Return the number of idle connections available for borrowing.

int
getWaitingCount()

Return the number of coroutines waiting for capacity.

array
getStats()

Return the pool's current resource counts and closed state.

Details

at line 14
string getName()

Get the pool name.

Return Value

string

at line 19
Connection borrow()

Borrow a connection from the pool.

Return Value

Connection

at line 24
void release(Connection $connection)

Release a connection back to the connection pool.

Parameters

Connection $connection

Return Value

void

at line 29
void discard(Connection $connection)

Discard a borrowed connection from the connection pool.

Parameters

Connection $connection

Return Value

void

at line 36
void trimExcessIdle()

Close excess idle connections without checking their age.

Stop when the managed count reaches the retained minimum or no idle connections remain.

Return Value

void

at line 41
void close()

Close the connection pool and release its resources.

Return Value

void

at line 46
bool isClosed()

Determine if the connection pool is closed.

Return Value

bool

at line 51
PoolOptions getOptions()

Get the pool configuration options.

Return Value

PoolOptions

at line 56
int getManagedCount()

Return the number of connections managed by the pool.

Return Value

int

at line 61
int getBorrowedCount()

Return the number of connections borrowed by callers.

Return Value

int

at line 66
int getIdleCount()

Return the number of idle connections available for borrowing.

Return Value

int

at line 71
int getWaitingCount()

Return the number of coroutines waiting for capacity.

Return Value

int

at line 78
array getStats()

Return the pool's current resource counts and closed state.

Return Value

array