Skip to content

QueueWorker

Drives a PollableQueueDriverInterface’s backlog one job at a time; used by queue:work.

final readonly class QueueWorker

SourceQueueWorker.php

public function __construct(JobExecutor $executor): mixed

ParameterTypeDescription
$executorJobExecutor

Returns mixed

MethodDescription
processNext(PollableQueueDriverInterface $driver): bool

public function processNext(PollableQueueDriverInterface $driver): bool

ParameterTypeDescription
$driverPollableQueueDriverInterface

Returns bool — True if a job was reserved and processed (success or failure); false if the queue was empty.