DispatchLockContext
class DispatchLockContext
| internal |
Track dispatch lock ownership until a queue accepts the job.
Properties
| static protected null|LockRecord> | $records | The lock records owned by live dispatch operations. |
Methods
Register an acquired unique lock.
Register an acquired debounce lock.
Peek at hidden unique-job payload metadata.
Determine whether a dispatch owns any locks.
Delegate a dispatch's lock ownership to a registered callback.
Claim lock ownership in a delegated callback.
Mark a dispatch as accepted by a queue.
Release locks still owned by a dispatch.
Take a release snapshot for work accepted by an in-memory timer.
Release locks from an in-memory timer snapshot.
Get a dispatch's current lock record.
Set whether a dispatch's lock ownership has been delegated.
Create an empty dispatch lock record.
Flush all static state.
Details
at line 45
static void
registerUnique(object $job, Repository $cache, string|null $cacheStore, string $key, string $owner)
Register an acquired unique lock.
at line 70
static void
registerDebounce(object $job, Repository $cache, string $key, string $owner)
Register an acquired debounce lock.
at line 89
static array|null
peekPayloadMetadata(object $job)
Peek at hidden unique-job payload metadata.
at line 97
static bool
has(object $job)
Determine whether a dispatch owns any locks.
at line 105
static bool
delegate(object $job)
Delegate a dispatch's lock ownership to a registered callback.
at line 113
static bool
claim(object $job)
Claim lock ownership in a delegated callback.
at line 121
static void
accept(object $job)
Mark a dispatch as accepted by a queue.
at line 133
static void
release(object $job)
Release locks still owned by a dispatch.
at line 160
static array|null
snapshot(object $job)
Take a release snapshot for work accepted by an in-memory timer.
at line 179
static void
releaseSnapshot(array $snapshot)
Release locks from an in-memory timer snapshot.
at line 217
static protected array|null
record(object $job)
Get a dispatch's current lock record.
at line 229
static protected bool
setDelegated(object $job, bool $delegated)
Set whether a dispatch's lock ownership has been delegated.
at line 249
static protected array
newRecord()
Create an empty dispatch lock record.
at line 262
static void
flushState()
Flush all static state.