interface Lock (View source)

Methods

bool
get(callable|null $callback = null)

Attempt to acquire the lock.

bool
block(int $seconds, callable|null $callback = null)

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

void
release()

Release the lock.

string
owner()

Returns the current owner of the lock.

void
forceRelease()

Releases this lock in disregard of ownership.

Details

bool get(callable|null $callback = null)

Attempt to acquire the lock.

Parameters

callable|null $callback

Return Value

bool

bool 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

bool

void release()

Release the lock.

Return Value

void

string owner()

Returns the current owner of the lock.

Return Value

string

void forceRelease()

Releases this lock in disregard of ownership.

Return Value

void