RefreshableLease
interface RefreshableLease implements Lease
A lease that supports refreshing its TTL and inspecting remaining lifetime.
Semantics mirror RefreshableLock: refresh() is atomic and owner-checked, refresh(null) re-applies the duration the slot was acquired with as the backend interpreted it, and an explicit non-positive TTL throws.
Methods
bool
refresh(int|null $seconds = null)
Refresh the lease's TTL if still owned by this lease.
float|null
getRemainingLifetime()
Get the number of seconds until the lease expires.
Details
in
Lease at line 20
bool
release()
Release the held slot if still owned by this lease.
in
Lease at line 25
string
owner()
Get the owner identifier of this lease.
at line 26
bool
refresh(int|null $seconds = null)
Refresh the lease's TTL if still owned by this lease.
at line 33
float|null
getRemainingLifetime()
Get the number of seconds until the lease expires.