class PoolProxy

Methods

__construct(PoolDefinition $definition, Closure $resolver, Factory $pools, Closure|null $releaseCallback = null)

Create a proxy that resolves its current pool per operation.

pool()

Resolve the current pool for this proxy's definition.

lease()

Borrow an object under an exactly-once lease.

mixed
invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

void
configureBorrowed(object $object)

Apply proxy-held state to a freshly borrowed object.

getDefinition()

Get this proxy's immutable pool definition.

string
getPoolName()

Get this proxy's pool identity.

bool
invalidatePool()

Remove and close this proxy's current shared pool.

Details

at line 17
__construct(PoolDefinition $definition, Closure $resolver, Factory $pools, Closure|null $releaseCallback = null)

Create a proxy that resolves its current pool per operation.

Parameters

PoolDefinition $definition
Closure $resolver
Factory $pools
Closure|null $releaseCallback

at line 28
protected ObjectPool pool()

Resolve the current pool for this proxy's definition.

Return Value

ObjectPool

at line 36
protected Lease lease()

Borrow an object under an exactly-once lease.

Return Value

Lease

at line 59
protected mixed invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

Parameters

string $method
array $arguments

Return Value

mixed

at line 83
protected void configureBorrowed(object $object)

Apply proxy-held state to a freshly borrowed object.

Parameters

object $object

Return Value

void

at line 90
PoolDefinition getDefinition()

Get this proxy's immutable pool definition.

Return Value

PoolDefinition

at line 98
string getPoolName()

Get this proxy's pool identity.

Return Value

string

at line 106
bool invalidatePool()

Remove and close this proxy's current shared pool.

Return Value

bool