interface ObjectPool

Methods

object
borrow()

Borrow an object from the pool.

void
release(object $object)

Release an object back to the object pool.

void
discard(object $object)

Destroy a checked-out object instead of returning it to the pool.

void
sweepExpired()

Destroy idle objects that exceed the maximum lifetime.

void
trimIdle()

Destroy idle objects past the maximum idle time down to the retention floor.

void
close()

Close the pool and destroy all idle objects.

bool
isClosed()

Determine if the pool is closed.

bool
isIdleExpired()

Determine if the entire pool has exceeded its idle timeout.

int
getBorrowedCount()

Return the number of objects currently checked out.

int
getManagedCount()

Return the current number of objects managed by the pool.

int
getIdleCount()

Return the number of objects currently available in the pool.

int
getWaitingCount()

Return the number of coroutines waiting for an object.

getOptions()

Get the normalized pool options.

array
getStats()

Return statistics about the pool's current state.

Details

at line 14
object borrow()

Borrow an object from the pool.

Return Value

object

at line 19
void release(object $object)

Release an object back to the object pool.

Parameters

object $object

Return Value

void

at line 24
void discard(object $object)

Destroy a checked-out object instead of returning it to the pool.

Parameters

object $object

Return Value

void

at line 29
void sweepExpired()

Destroy idle objects that exceed the maximum lifetime.

Return Value

void

at line 34
void trimIdle()

Destroy idle objects past the maximum idle time down to the retention floor.

Return Value

void

at line 39
void close()

Close the pool and destroy all idle objects.

Return Value

void

at line 44
bool isClosed()

Determine if the pool is closed.

Return Value

bool

at line 49
bool isIdleExpired()

Determine if the entire pool has exceeded its idle timeout.

Return Value

bool

at line 54
int getBorrowedCount()

Return the number of objects currently checked out.

Return Value

int

at line 59
int getManagedCount()

Return the current number of objects managed by the pool.

Return Value

int

at line 64
int getIdleCount()

Return the number of objects currently available in the pool.

Return Value

int

at line 69
int getWaitingCount()

Return the number of coroutines waiting for an object.

Return Value

int

at line 74
PoolOptions getOptions()

Get the normalized pool options.

Return Value

PoolOptions

at line 81
array getStats()

Return statistics about the pool's current state.

Return Value

array