SupervisorOptions
class SupervisorOptions
Properties
| string|null | $queue | The queue that should be utilized. |
|
| bool | $autoScale | Indicates if the supervisor should auto-scale. |
|
| string|null | $directory | The working directories that new workers should be started from. |
|
| int | $retryAfter | The number of seconds to wait before retrying a job that encountered an uncaught exception. |
Methods
Create a new worker options instance.
Create a fresh options instance with the given queue.
Determine if a balancing strategy should be used.
Determine if auto-scaling should be applied.
Determine if auto-scaling should be based on the number of jobs on the queue instead of time-to-clear.
Get the command-line representation of the options for a supervisor.
Get the command-line representation of the options for a worker.
Convert the options to a JSON string.
Convert the options to a raw array.
Create a new options instance from the given array.
Details
at line 53
__construct(string $name, string $connection, string|null $queue = null, string $workersName = 'default', bool|string $balance = 'off', int|string $backoff = 0, int $maxTime = 0, int $maxJobs = 0, int $maxProcesses = 1, int $minProcesses = 1, int $concurrency = 1, int $memory = 128, int $timeout = 60, int $sleep = 3, int $maxTries = 0, bool $force = false, int $nice = 0, int $balanceCooldown = 3, int $balanceMaxShift = 1, int $parentId = 0, int $rest = 0, string|null $autoScalingStrategy = 'time')
Create a new worker options instance.
at line 85
SupervisorOptions
withQueue(string $queue)
Create a fresh options instance with the given queue.
at line 95
bool
balancing()
Determine if a balancing strategy should be used.
at line 103
bool
autoScaling()
Determine if auto-scaling should be applied.
at line 111
bool
autoScaleByNumberOfJobs()
Determine if auto-scaling should be based on the number of jobs on the queue instead of time-to-clear.
at line 119
string
toSupervisorCommand()
Get the command-line representation of the options for a supervisor.
at line 127
string
toWorkerCommand()
Get the command-line representation of the options for a worker.
at line 135
string
toJson()
Convert the options to a JSON string.
at line 143
array
toArray()
Convert the options to a raw array.
at line 174
static SupervisorOptions
fromArray(array $array)
Create a new options instance from the given array.