UniqueLock
class UniqueLock (View source)
Traits
Properties
| protected Repository | $cache | The cache repository implementation. |
Methods
mixed
getAttributeValue(object $job, string $attributeClass, string|null $property = null, mixed $default = null)
Get a configuration value from an attribute, falling back to a property.
from
ReadsQueueAttributes
mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
from
ReadsQueueAttributes
bool
acquire(mixed $job)
Attempt to acquire a lock for the given job.
void
release(mixed $job)
Release the lock for the given job.
static string
getKey(mixed $job)
Generate the lock key for the given job.
Details
protected mixed
getAttributeValue(object $job, string $attributeClass, string|null $property = null, mixed $default = null)
Get a configuration value from an attribute, falling back to a property.
protected mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
__construct(Repository $cache)
Create a new unique lock manager instance.
bool
acquire(mixed $job)
Attempt to acquire a lock for the given job.
void
release(mixed $job)
Release the lock for the given job.
static string
getKey(mixed $job)
Generate the lock key for the given job.