interface LockInterface

LockInterface defines an interface to manipulate the status of a lock.

Methods

bool
acquire(bool $blocking = false)

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

refresh()

Increase the duration of an acquired lock.

bool
isAcquired()

Returns whether or not the lock is acquired.

release()

Release the lock.

Details

at line line 36
bool acquire(bool $blocking = false)

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

Parameters

bool $blocking Whether or not the Lock should wait for the release of someone else

Return Value

bool whether or not the lock had been acquired

Exceptions

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

at line line 44
refresh()

Increase the duration of an acquired lock.

Exceptions

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

at line line 51
bool isAcquired()

Returns whether or not the lock is acquired.

Return Value

bool

at line line 58
release()

Release the lock.

Exceptions

LockReleasingException If the lock can not be released