CallQueuedHandler
class CallQueuedHandler (View source)
Properties
protected Dispatcher | $dispatcher | The bus dispatcher implementation. |
|
protected Container | $container | The container instance. |
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.
Ensure the lock for a unique job is released.
Ensure the batch is notified of the failed job.
Ensure the chained job catch callbacks are invoked.
Details
void
__construct(Dispatcher $dispatcher, Container $container)
Create a new handler instance.
void
call(Job $job, array $data)
Handle the queued job.
protected mixed
getCommand(array $data)
Get the command from the given payload.
protected mixed
dispatchThroughMiddleware(Job $job, mixed $command)
Dispatch the given job / command through its specified middleware.
protected mixed
resolveHandler(Job $job, mixed $command)
Resolve the handler for the given command.
protected mixed
setJobInstanceIfNecessary(Job $job, mixed $instance)
Set the job instance of the given class if necessary.
protected void
ensureNextJobInChainIsDispatched(mixed $command)
Ensure the next job in the chain is dispatched if applicable.
protected void
ensureSuccessfulBatchJobIsRecorded(mixed $command)
Ensure the batch is notified of the successful job completion.
protected void
ensureUniqueJobLockIsReleased(mixed $command)
Ensure the lock for a unique job is released.
void
failed(array $data, Throwable|null $e, string $uuid)
Call the failed method on the job instance.
The exception that caused the failure will be passed.
protected void
ensureFailedBatchJobIsRecorded(string $uuid, mixed $command, Throwable $e)
Ensure the batch is notified of the failed job.
protected void
ensureChainCatchCallbacksAreInvoked(string $uuid, mixed $command, Throwable $e)
Ensure the chained job catch callbacks are invoked.