UniqueLock
class UniqueLock
Traits
Methods
Get a configuration value from an attribute, falling back to a property.
Extract the value from an attribute instance.
Get an instance of the given attribute class from the target class or its parents.
Determine if a property declared on a child class overrides an inherited attribute.
Attempt to acquire a lock for the given job.
Attempt to acquire and register a lock owned by a dispatch operation.
Resolve the values needed to acquire a unique lock.
Acquire a unique lock using resolved values.
Release the lock for the given job.
Release a unique lock from already-resolved provenance.
Generate the lock key for the given job.
Details
in
ReadsClassAttributes at line 17
protected mixed
getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)
Get a configuration value from an attribute, falling back to a property.
in
ReadsClassAttributes at line 46
protected mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
in
ReadsClassAttributes at line 58
protected object|null
getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)
Get an instance of the given attribute class from the target class or its parents.
in
ReadsClassAttributes at line 74
protected bool
propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)
Determine if a property declared on a child class overrides an inherited attribute.
at line 20
__construct(Repository $cache)
Create a new unique lock manager instance.
at line 28
bool
acquire(mixed $job)
Attempt to acquire a lock for the given job.
at line 44
bool
acquireForDispatch(object $job)
Attempt to acquire and register a lock owned by a dispatch operation.
at line 72
protected array
resolveLockValues(mixed $job)
Resolve the values needed to acquire a unique lock.
at line 95
protected false|string
acquireResolvedLock(mixed $job, Repository $cache, string $key, int $uniqueFor, bool $supportsOwnership, bool $captureOwner = false)
Acquire a unique lock using resolved values.
at line 128
void
release(mixed $job, string $owner = '')
Release the lock for the given job.
at line 146
static void
releaseOwned(Repository $cache, string $key, string $owner = '')
| internal |
Release a unique lock from already-resolved provenance.
at line 164
static string
getKey(mixed $job)
Generate the lock key for the given job.