class WorkerOptions

Methods

__construct(string $name = 'default', array|int $backoff = 0, float $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, int $concurrency = 1, int $monitorInterval = 1, array $coroutineContext = [])

Create a new worker options instance.

Details

at line 28
__construct(string $name = 'default', array|int $backoff = 0, float $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, int $concurrency = 1, int $monitorInterval = 1, array $coroutineContext = [])

Create a new worker options instance.

Parameters

string $name

the name of the worker

array|int $backoff
float $memory

the maximum amount of RAM in megabytes 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 $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 $maxJobs

the maximum number of jobs to run

int $maxTime

the maximum number of seconds a worker may live

int $rest

the number of seconds to rest between jobs

int $stopWhenEmptyFor

the number of seconds the queue may remain empty

int $concurrency

the number of jobs to process at once

int $monitorInterval

the number of seconds between timeout scans

array $coroutineContext

context values to seed while each job runs