CallQueuedHandler
class CallQueuedHandler
Constants
| protected MISSING_MODEL_FAILURE_CONTEXT_KEY |
The context key for the job being failed because its command's models are missing. |
Properties
| protected mixed | $runningCommand | The command currently being processed. |
Methods
Get the command from the given payload.
Dispatch the given job / command through its specified middleware.
Set the job instance of the given class if necessary.
Ensure the next job in the chain is dispatched if applicable.
Ensure the batch is notified of the successful job completion.
Determine if the unique job lock should be released.
Resolve the unique lock owner carried by the command or its queued payload.
Ensure the lock for a unique job is released.
Determine if the debounced command was superseded by a newer dispatch.
Handle a debounced job by firing an event and deleting it.
Determine if the given command should be unique.
Determine if the given command should be unique until processing begins.
Release the unique lock of a job whose command cannot be restored because its models are missing.
Determine if an ownerless unique lock still belongs to a job whose models are missing.
Ensure the lock for a unique job is released via context.
Record a potentially batched job as successful when deleted because models were missing.
Ensure the batch is notified of the failed job.
Record a potentially batched job as failed when its models are missing.
Ensure the chained job catch callbacks are invoked.
Get the command currently being processed.
Details
at line 48
__construct(Dispatcher $dispatcher, Container $container)
Create a new handler instance.
at line 57
void
call(Job $job, array $data)
Handle the queued job.
at line 102
protected mixed
getCommand(array $data)
Get the command from the given payload.
at line 120
protected mixed
dispatchThroughMiddleware(Job $job, mixed $command)
Dispatch the given job / command through its specified middleware.
at line 157
protected mixed
resolveHandler(Job $job, mixed $command)
Resolve the handler for the given command.
at line 174
protected mixed
setJobInstanceIfNecessary(Job $job, mixed $instance)
Set the job instance of the given class if necessary.
at line 186
protected void
ensureNextJobInChainIsDispatched(mixed $command)
Ensure the next job in the chain is dispatched if applicable.
at line 196
protected void
ensureSuccessfulBatchJobIsRecorded(mixed $command)
Ensure the batch is notified of the successful job completion.
at line 212
protected bool
uniqueJobLockShouldBeReleased(Job $job, mixed $command)
Determine if the unique job lock should be released.
at line 222
protected string
getUniqueJobLockOwner(Job $job, mixed $command)
Resolve the unique lock owner carried by the command or its queued payload.
at line 240
protected void
ensureUniqueJobLockIsReleased(mixed $command, bool $onlyOwned = false, Job|null $job = null)
Ensure the lock for a unique job is released.
at line 254
protected bool
commandShouldBeDebounced(mixed $command)
Determine if the debounced command was superseded by a newer dispatch.
at line 276
protected void
deleteDebouncedJob(Job $job, mixed $command)
Handle a debounced job by firing an event and deleting it.
at line 293
protected bool
commandShouldBeUnique(mixed $command)
Determine if the given command should be unique.
at line 302
protected bool
commandShouldBeUniqueUntilProcessing(mixed $command)
Determine if the given command should be unique until processing begins.
at line 311
protected void
handleModelNotFound(Job $job, Throwable $e)
Handle a model not found exception.
at line 345
protected void
ensureUniqueJobLockIsReleasedForMissingModel(Job|null $job, array $payload, bool $beforeProcessing)
Release the unique lock of a job whose command cannot be restored because its models are missing.
at line 394
protected bool
ownerlessUniqueLockMayBeReleasedForMissingModel(Job|null $job, array $payload, bool $beforeProcessing)
Determine if an ownerless unique lock still belongs to a job whose models are missing.
at line 420
protected void
ensureUniqueJobLockIsReleasedViaContext()
Ensure the lock for a unique job is released via context.
This is required when we can't unserialize the job due to missing models.
at line 453
protected void
ensureSuccessfulBatchJobIsRecordedForMissingModel(Job $job, string $class)
Record a potentially batched job as successful when deleted because models were missing.
at line 481
void
failed(array $data, Throwable|null $e, string $uuid, Job|null $job = null)
Call the failed method on the job instance.
The exception that caused the failure will be passed.
at line 522
protected void
ensureFailedBatchJobIsRecorded(string $uuid, mixed $command, Throwable|null $e)
Ensure the batch is notified of the failed job.
at line 536
protected void
ensureFailedBatchJobIsRecordedForMissingModel(string $uuid, array $data, Throwable|null $e)
Record a potentially batched job as failed when its models are missing.
at line 556
protected void
ensureChainCatchCallbacksAreInvoked(string $uuid, mixed $command, Throwable|null $e)
Ensure the chained job catch callbacks are invoked.
at line 566
mixed
getRunningCommand()
Get the command currently being processed.