Lock
interface Lock
Methods
bool
acquire()
Attempt to acquire the lock.
mixed
get(callable|null $callback = null)
Attempt to acquire the lock.
mixed
block(int $seconds, callable|null $callback = null)
Attempt to acquire the lock for the given number of seconds.
betweenBlockedAttemptsSleepFor(int $milliseconds)
Specify the number of milliseconds to sleep in between blocked lock acquisition attempts.
bool
release()
Release the lock.
string
owner()
Returns the current owner of the lock.
bool
isLocked()
Determine if the lock is currently held by any process.
void
forceRelease()
Releases this lock in disregard of ownership.
Details
at line 12
bool
acquire()
Attempt to acquire the lock.
at line 17
mixed
get(callable|null $callback = null)
Attempt to acquire the lock.
at line 22
mixed
block(int $seconds, callable|null $callback = null)
Attempt to acquire the lock for the given number of seconds.
at line 27
Lock
betweenBlockedAttemptsSleepFor(int $milliseconds)
Specify the number of milliseconds to sleep in between blocked lock acquisition attempts.
at line 32
bool
release()
Release the lock.
at line 37
string
owner()
Returns the current owner of the lock.
at line 42
bool
isLocked()
Determine if the lock is currently held by any process.
at line 47
void
forceRelease()
Releases this lock in disregard of ownership.