class CacheCommandMutex implements CommandMutex

Traits

Properties

string|null $store

The cache store that should be used.

Methods

int
secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

int
currentTime()

Get the current system time as a UNIX timestamp.

string
runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

__construct(Factory $cache)

No description

bool
create(Command $command)

Attempt to obtain a command mutex for the given command.

bool
exists(Command $command)

Determine if a command mutex exists for the given command.

bool
forget(Command $command)

Release the mutex for the given command.

string
commandMutexName(Command $command)

Get the isolatable command mutex name.

bool
shouldUseLocks(Store $store)

Determine if the given store should use locks for command mutexes.

useStore(string|null $store)

Specify the cache store that should be used.

Details

in InteractsWithTime at line 17
protected int secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

Parameters

DateInterval|DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

int

in InteractsWithTime at line 41
protected DateTimeInterface|int parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

DateTimeInterface|int

in InteractsWithTime at line 57
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in InteractsWithTime at line 65
protected string runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

Parameters

float $startTime
float|null $endTime

Return Value

string

at line 22
__construct(Factory $cache)

No description

Parameters

Factory $cache

at line 30
bool create(Command $command)

Attempt to obtain a command mutex for the given command.

Parameters

Command $command

Return Value

bool

at line 52
bool exists(Command $command)

Determine if a command mutex exists for the given command.

Parameters

Command $command

Return Value

bool

at line 69
bool forget(Command $command)

Release the mutex for the given command.

Parameters

Command $command

Return Value

bool

at line 86
protected string commandMutexName(Command $command)

Get the isolatable command mutex name.

Parameters

Command $command

Return Value

string

at line 100
protected bool shouldUseLocks(Store $store)

Determine if the given store should use locks for command mutexes.

Parameters

Store $store

Return Value

bool

at line 111
CacheCommandMutex useStore(string|null $store)

Specify the cache store that should be used.

Boot-only. Mutates the shared command mutex instance for the worker lifetime; per-request use races across coroutines.

Parameters

string|null $store

Return Value

CacheCommandMutex