CacheCommandMutex
class CacheCommandMutex implements CommandMutex (View source)
Traits
| InteractsWithTime |
Properties
| Factory | $cache | The cache factory implementation. | |
| string|null | $store | The cache store that should be used. |
Methods
| int | secondsUntil(DateTimeInterface|DateInterval|int $delay)
Get the number of seconds until the given DateTime. | from InteractsWithTime |
| int | availableAt(DateTimeInterface|DateInterval|int $delay = 0)
Get the "available at" UNIX timestamp. | from InteractsWithTime |
| DateTimeInterface|int | parseDateInterval(DateTimeInterface|DateInterval|int $delay)
If the given value is an interval, convert it to a DateTime instance. | from InteractsWithTime |
| int | currentTime()
Get the current system time as a UNIX timestamp. | from InteractsWithTime |
| __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. | |
| string | commandMutexName(Command $command)
Get the isolatable command mutex name. | |
| $this | useStore(string|null $store)
Specify the cache store that should be used. | |
| bool | shouldUseLocks(Store $store)
Determine if the given store should use locks for command mutexes. |
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.
__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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Console/CacheCommandMutex.html