Lease
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.
never
never
__destruct()
Finalize an abandoned lease without letting cleanup failures escape.
Details
at line 22
__construct(ObjectPool $pool, object $object, Closure|null $releaseCallback = null)
Create a lease for one checked-out object.
at line 32
object
get()
Get the borrowed object.
at line 44
void
release()
Run reset behavior and return the object to the pool.
at line 83
void
discard()
Destroy the borrowed object instead of returning it to the pool.
at line 96
never
releaseAfterFailure(Throwable $failure)
Release the object while preserving failure precedence.
at line 112
never
discardAfterFailure(Throwable $failure)
Discard the object while preserving failure precedence.
at line 128
__destruct()
Finalize an abandoned lease without letting cleanup failures escape.