class Lease

Properties

protected bool $finalized

Methods

__construct(ObjectPool $pool, object $object, Closure|null $releaseCallback = null)

Create a lease for one checked-out object.

object
get()

Get the borrowed object.

void
release()

Run reset behavior and return the object to the pool.

void
discard()

Destroy the borrowed object instead of returning it to the pool.

__destruct()

Finalize an abandoned lease without letting cleanup failures escape.

Details

at line 21
__construct(ObjectPool $pool, object $object, Closure|null $releaseCallback = null)

Create a lease for one checked-out object.

Parameters

ObjectPool $pool
object $object
Closure|null $releaseCallback

at line 31
object get()

Get the borrowed object.

Return Value

object

at line 43
void release()

Run reset behavior and return the object to the pool.

Return Value

void

at line 71
void discard()

Destroy the borrowed object instead of returning it to the pool.

Return Value

void

at line 84
__destruct()

Finalize an abandoned lease without letting cleanup failures escape.