Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class FlockLock (1.60.0)

Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class FlockLock.

Flock based lock implementation.

Namespace

Google \ Cloud \ Core \ Lock

Methods

__construct

Parameters
Name Description
fileName string

The name of the file to use as a lock.

options array

Configuration options.

↳ exclusive bool

If true, acquire an excluse (write) lock. If false, acquire a shared (read) lock. Defaults to true.

acquire

Acquires a lock that will block until released.

Parameters
Name Description
options array

Configuration options.

↳ blocking bool

Whether the process should block while waiting to acquire the lock. Defaults to true.

Returns
Type Description
bool

release

Releases the lock.

Constants

FILE_PATH_TEMPLATE

Value: '%s/%s.lock'