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.

Return Value

bool

at line 17
mixed get(callable|null $callback = null)

Attempt to acquire the lock.

Parameters

callable|null $callback

Return Value

mixed

at line 22
mixed block(int $seconds, callable|null $callback = null)

Attempt to acquire the lock for the given number of seconds.

Parameters

int $seconds
callable|null $callback

Return Value

mixed

at line 27
Lock betweenBlockedAttemptsSleepFor(int $milliseconds)

Specify the number of milliseconds to sleep in between blocked lock acquisition attempts.

Parameters

int $milliseconds

Return Value

Lock

at line 32
bool release()

Release the lock.

Return Value

bool

at line 37
string owner()

Returns the current owner of the lock.

Return Value

string

at line 42
bool isLocked()

Determine if the lock is currently held by any process.

Return Value

bool

at line 47
void forceRelease()

Releases this lock in disregard of ownership.

Return Value

void