CacheCommandMutex
class CacheCommandMutex implements CommandMutex (View source)
Traits
Properties
Factory | $cache | The cache factory implementation. |
|
string|null | $store | The cache store that should be used. |
Methods
Get the number of seconds until the given DateTime.
If the given value is an interval, convert it to a DateTime instance.
Given a start time, format the total run time for human readability.
Specify the cache store that should be used.
Details
protected int
secondsUntil(DateTimeInterface|DateInterval|int $delay)
Get the number of seconds until the given DateTime.
protected int
availableAt(DateTimeInterface|DateInterval|int $delay = 0)
Get the "available at" UNIX timestamp.
protected DateTimeInterface|int
parseDateInterval(DateTimeInterface|DateInterval|int $delay)
If the given value is an interval, convert it to a DateTime instance.
protected int
currentTime()
Get the current system time as a UNIX timestamp.
protected string
runTimeForHumans(float $startTime, float $endTime = null)
Given a start time, format the total run time for human readability.
__construct(Factory $cache)
Create a new command mutex.
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.
protected string
commandMutexName(Command $command)
Get the isolatable command mutex name.
$this
useStore(string|null $store)
Specify the cache store that should be used.
protected bool
shouldUseLocks(Store $store)
Determine if the given store should use locks for command mutexes.