DebounceLock
class DebounceLock
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.
Store a debounce owner token for the given job.
Store and register a debounce owner token for a dispatch operation.
Resolve the values needed to acquire a debounce lock.
Store a debounce owner token using resolved values.
Determine if the maximum debounce wait time has been exceeded.
Get the current owner for the given job.
Remove the debounce token for the given job.
Remove the maximum wait timestamp for the given job.
Release a debounce lock from already-resolved provenance.
Get the debounce delay for the given job.
Get the maximum debounce wait time for the given job.
Generate the cache key for the given job.
Resolve the cache store 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 22
__construct(Repository $cache)
Create a new debounce lock manager instance.
at line 34
array
acquire(mixed $job, int|null $debounceFor = null, int|null $maxWait = null)
Store a debounce owner token for the given job.
Overwrites any existing token, implementing last-writer-wins semantics.
at line 46
array
acquireForDispatch(object $job, int|null $debounceFor = null, int|null $maxWait = null)
Store and register a debounce owner token for a dispatch operation.
at line 66
protected array
resolveLockValues(mixed $job, int|null $debounceFor, int|null $maxWait)
Resolve the values needed to acquire a debounce lock.
at line 84
protected array
acquireResolvedLock(Repository $cache, string $key, int $ttl, int|null $maxWait)
Store a debounce owner token using resolved values.
at line 109
protected bool
maxWaitExceeded(Repository $cache, string $key, int $ttl, int|null $maxWait)
Determine if the maximum debounce wait time has been exceeded.
at line 138
string|null
getCurrentOwner(mixed $job)
Get the current owner for the given job.
at line 149
void
release(mixed $job, string $owner = '')
Remove the debounce token for the given job.
at line 159
void
releaseMaxWait(mixed $job)
Remove the maximum wait timestamp for the given job.
at line 169
static void
releaseOwned(Repository $cache, string $key, string $owner = '')
| internal |
Release a debounce lock from already-resolved provenance.
at line 197
int|null
getDebounceDelay(mixed $job)
Get the debounce delay for the given job.
at line 212
int|null
getMaxDebounceWait(mixed $job)
Get the maximum debounce wait time for the given job.
at line 220
static string
getKey(mixed $job)
Generate the cache key for the given job.
at line 237
protected Repository
resolveCache(mixed $job)
Resolve the cache store for the given job.