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

static void
registerUnique(object $job, Repository $cache, string|null $cacheStore, string $key, string $owner)

Register an acquired unique lock.

static void
registerDebounce(object $job, Repository $cache, string $key, string $owner)

Register an acquired debounce lock.

static array|null
peekPayloadMetadata(object $job)

Peek at hidden unique-job payload metadata.

static bool
has(object $job)

Determine whether a dispatch owns any locks.

static bool
delegate(object $job)

Delegate a dispatch's lock ownership to a registered callback.

static bool
claim(object $job)

Claim lock ownership in a delegated callback.

static void
accept(object $job)

Mark a dispatch as accepted by a queue.

static void
release(object $job)

Release locks still owned by a dispatch.

static array|null
snapshot(object $job)

Take a release snapshot for work accepted by an in-memory timer.

static void
releaseSnapshot(array $snapshot)

Release locks from an in-memory timer snapshot.

static array|null
record(object $job)

Get a dispatch's current lock record.

static bool
setDelegated(object $job, bool $delegated)

Set whether a dispatch's lock ownership has been delegated.

static array
newRecord()

Create an empty dispatch lock record.

static void
flushState()

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.

Parameters

object $job
Repository $cache
string|null $cacheStore
string $key
string $owner

Return Value

void

at line 70
static void registerDebounce(object $job, Repository $cache, string $key, string $owner)

Register an acquired debounce lock.

Parameters

object $job
Repository $cache
string $key
string $owner

Return Value

void

at line 89
static array|null peekPayloadMetadata(object $job)

Peek at hidden unique-job payload metadata.

Parameters

object $job

Return Value

array|null

at line 97
static bool has(object $job)

Determine whether a dispatch owns any locks.

Parameters

object $job

Return Value

bool

at line 105
static bool delegate(object $job)

Delegate a dispatch's lock ownership to a registered callback.

Parameters

object $job

Return Value

bool

at line 113
static bool claim(object $job)

Claim lock ownership in a delegated callback.

Parameters

object $job

Return Value

bool

at line 121
static void accept(object $job)

Mark a dispatch as accepted by a queue.

Parameters

object $job

Return Value

void

at line 133
static void release(object $job)

Release locks still owned by a dispatch.

Parameters

object $job

Return Value

void

at line 160
static array|null snapshot(object $job)

Take a release snapshot for work accepted by an in-memory timer.

Parameters

object $job

Return Value

array|null

at line 179
static void releaseSnapshot(array $snapshot)

Release locks from an in-memory timer snapshot.

Parameters

array $snapshot

Return Value

void

at line 217
static protected array|null record(object $job)

Get a dispatch's current lock record.

Parameters

object $job

Return Value

array|null

at line 229
static protected bool setDelegated(object $job, bool $delegated)

Set whether a dispatch's lock ownership has been delegated.

Parameters

object $job
bool $delegated

Return Value

bool

at line 249
static protected array newRecord()

Create an empty dispatch lock record.

Return Value

array

at line 262
static void flushState()

Flush all static state.

Return Value

void