class NoLock implementsSharedLockInterface

A non locking lock.

This can be used to disable locking in classes requiring a lock.

Methods

bool
acquireRead(bool$blocking =false)

Acquires the lock for reading. If the lock is acquired by someone else in write mode, the parameter blocking determines whether or not the call should block until the release of the lock.

bool
acquire(bool$blocking =false)

Acquires the lock. If the lock is acquired by someone else, the parameter blocking determines whether or not the call should block until the release of the lock.

void
refresh(float|null$ttl =null)

Increase the duration of an acquired lock.

bool
isAcquired()

Returns whether or not the lock is acquired.

void
release()

Release the lock.

bool
isExpired()

No description

float|null
getRemainingLifetime()

Returns the remaining lifetime in seconds.

Details

bool acquireRead(bool$blocking =false)

Acquires the lock for reading. If the lock is acquired by someone else in write mode, the parameter blocking determines whether or not the call should block until the release of the lock.

Parameters

bool $blocking

Return Value

bool

Exceptions

LockConflictedException If the lock is acquired by someone else in blocking mode
LockAcquiringException If the lock cannot be acquired

bool acquire(bool$blocking =false)

Acquires the lock. If the lock is acquired by someone else, the parameter blocking determines whether or not the call should block until the release of the lock.

Parameters

bool $blocking

Return Value

bool

Exceptions

LockConflictedException If the lock is acquired by someone else in blocking mode
LockAcquiringException If the lock cannot be acquired

void refresh(float|null$ttl =null)

Increase the duration of an acquired lock.

Parameters

float|null $ttl Maximum expected lock duration in seconds

Return Value

void

Exceptions

LockConflictedException If the lock is acquired by someone else
LockAcquiringException If the lock cannot be refreshed

bool isAcquired()

Returns whether or not the lock is acquired.

Return Value

bool

void release()

Release the lock.

Return Value

void

Exceptions

LockReleasingException If the lock cannot be released

bool isExpired()

Return Value

bool

float|null getRemainingLifetime()

Returns the remaining lifetime in seconds.

Return Value

float|null