class RefreshableConcurrencyLease implements RefreshableLease

Methods

__construct(RefreshableLock $lock)

Create a new lease instance.

bool
release()

Release the held slot if still owned by this lease.

string
owner()

Get the owner identifier of this lease.

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

at line 16
__construct(RefreshableLock $lock)

Create a new lease instance.

Parameters

RefreshableLock $lock

at line 24
bool release()

Release the held slot if still owned by this lease.

Return Value

bool

at line 32
string owner()

Get the owner identifier of this lease.

Return Value

string

at line 42
bool refresh(int|null $seconds = null)

Refresh the lease's TTL if still owned by this lease.

Parameters

int|null $seconds

Seconds to set the TTL to (null = re-apply the acquisition TTL)

Return Value

bool

True if the lease was refreshed (or is permanent and still owned), false if not owned or expired

Exceptions

InvalidArgumentException

at line 50
float|null getRemainingLifetime()

Get the number of seconds until the lease expires.

Return Value

float|null

Seconds remaining, or null if the slot doesn't exist or has no expiry