class WorkerOptions (View source)

Properties

string $name

The name of the worker.

int|int[] $backoff

The number of seconds to wait before retrying a job that encountered an uncaught exception.

int $memory

The maximum amount of RAM the worker may consume.

int $timeout

The maximum number of seconds a child worker may run.

int $sleep

The number of seconds to wait in between polling the queue.

int $rest

The number of seconds to rest between jobs.

int $maxTries

The maximum number of times a job may be attempted.

bool $force

Indicates if the worker should run in maintenance mode.

bool $stopWhenEmpty

Indicates if the worker should stop when the queue is empty.

int $stopWhenEmptyFor

The number of seconds to wait for a job before stopping.

int $maxJobs

The maximum number of jobs to run.

int $maxTime

The maximum number of seconds a worker may live.

Methods

void
__construct(string $name = 'default', int|int[] $backoff = 0, int $memory = 128, int $timeout = 60, int $sleep = 3, int $maxTries = 1, bool $force = false, bool $stopWhenEmpty = false, int $maxJobs = 0, int $maxTime = 0, int $rest = 0, int $stopWhenEmptyFor = 0)

Create a new worker options instance.

Details

void __construct(string $name = 'default', int|int[] $backoff = 0, int $memory = 128, int $timeout = 60, int $sleep = 3, int $maxTries = 1, bool $force = false, bool $stopWhenEmpty = false, int $maxJobs = 0, int $maxTime = 0, int $rest = 0, int $stopWhenEmptyFor = 0)

Create a new worker options instance.

Parameters

string $name
int|int[] $backoff
int $memory
int $timeout
int $sleep
int $maxTries
bool $force
bool $stopWhenEmpty
int $maxJobs
int $maxTime
int $rest
int $stopWhenEmptyFor

Return Value

void

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.