W3cubDocs

/Laravel 5.4

Worker

class Worker (View source)

Properties

bool $shouldQuit Indicates if the worker should exit.
bool $paused Indicates if the worker is paused.

Methods

void __construct(QueueManager $manager, Dispatcher $events, ExceptionHandler $exceptions)

Create a new queue worker.

void daemon(string $connectionName, string $queue, WorkerOptions $options)

Listen to the given queue in a loop.

void runNextJob(string $connectionName, string $queue, WorkerOptions $options)

Process the next job on the queue.

void process(string $connectionName, Job $job, WorkerOptions $options)

Process the given job from the queue.

bool memoryExceeded(int $memoryLimit)

Determine if the memory limit has been exceeded.

void stop(int $status)

Stop listening and bail out of the script.

void kill(int $status)

Kill the process.

void sleep(int $seconds)

Sleep the script for a given number of seconds.

void setCache(Repository $cache)

Set the cache repository implementation.

Details

void __construct(QueueManager $manager, Dispatcher $events, ExceptionHandler $exceptions)

Create a new queue worker.

Parameters

QueueManager $manager
Dispatcher $events
ExceptionHandler $exceptions

Return Value

void

void daemon(string $connectionName, string $queue, WorkerOptions $options)

Listen to the given queue in a loop.

Parameters

string $connectionName
string $queue
WorkerOptions $options

Return Value

void

void runNextJob(string $connectionName, string $queue, WorkerOptions $options)

Process the next job on the queue.

Parameters

string $connectionName
string $queue
WorkerOptions $options

Return Value

void

void process(string $connectionName, Job $job, WorkerOptions $options)

Process the given job from the queue.

Parameters

string $connectionName
Job $job
WorkerOptions $options

Return Value

void

Exceptions

Throwable

bool memoryExceeded(int $memoryLimit)

Determine if the memory limit has been exceeded.

Parameters

int $memoryLimit

Return Value

bool

void stop(int $status)

Stop listening and bail out of the script.

Parameters

int $status

Return Value

void

void kill(int $status)

Kill the process.

Parameters

int $status

Return Value

void

void sleep(int $seconds)

Sleep the script for a given number of seconds.

Parameters

int $seconds

Return Value

void

void setCache(Repository $cache)

Set the cache repository implementation.

Parameters

Repository $cache

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Queue/Worker.html