ConcurrencyLease
class ConcurrencyLease implements RefreshableLease
A held slot in a Redis funnel limiter.
The owner id is stored and compared raw, never packed: the slot value is written by the acquire Lua script, compared raw by release/refresh scripts, and read raw during permanent-slot ownership checks. RedisLock writes through set(), so its owner must be packed before Lua comparisons; funnel leases do not.
Methods
Create a new lease instance.
Release the held slot if still owned by this lease.
Get the owner identifier of this lease.
Refresh the lease's TTL if still owned by this lease.
Get the number of seconds until the lease expires.
Details
at line 26
__construct(RedisProxy $redis, string $key, string $owner, int $releaseAfter)
Create a new lease instance.
at line 37
bool
release()
Release the held slot if still owned by this lease.
at line 45
string
owner()
Get the owner identifier of this lease.
at line 55
bool
refresh(int|null $seconds = null)
Refresh the lease's TTL if still owned by this lease.
at line 75
float|null
getRemainingLifetime()
Get the number of seconds until the lease expires.