ProcessPool
class ProcessPool implements Countable
Properties
| WorkerProcess> | $processes | All of the active processes. |
|
| CarbonImmutable}> | $terminatingProcesses | The processes that are terminating. |
|
| bool | $working | Indicates if the process pool is currently running. |
|
| Closure|null | $output | The output handler. |
Methods
Create a new process pool instance.
Scale the process count.
Scale up to the given number of processes.
Scale down to the given number of processes.
Remove the given number of processes from the process array.
Add a new worker process to the pool.
Create a new process instance.
Evaluate the current state of all of the processes.
Terminate all current workers and start fresh ones.
Pause all of the worker processes.
Instruct all of the worker processes to continue working.
Get the processes that are still terminating.
Remove any non-running processes from the terminating process list.
Stop any terminating processes that are hanging too long.
Get all of the current processes as a collection.
Get all of the current running processes as a collection.
Get the total active process count, including processes pending termination.
The name of the queue(s) being worked by the pool.
Count the total number of processes in the pool.
Details
at line 42
__construct(SupervisorOptions $options, Closure|null $output = null)
Create a new process pool instance.
at line 53
void
scale(int $processes)
Scale the process count.
at line 71
protected void
scaleUp(int $processes)
Scale up to the given number of processes.
at line 83
protected void
scaleDown(int $processes)
Scale down to the given number of processes.
at line 114
void
markForTermination(WorkerProcess $process)
Mark the given worker process for termination.
at line 124
protected void
removeProcesses(int $count)
Remove the given number of processes from the process array.
at line 132
protected ProcessPool
start()
Add a new worker process to the pool.
at line 144
protected WorkerProcess
createProcess()
Create a new process instance.
at line 159
void
monitor()
Evaluate the current state of all of the processes.
at line 167
void
restart()
Terminate all current workers and start fresh ones.
at line 179
void
pause()
Pause all of the worker processes.
at line 189
void
continue()
Instruct all of the worker processes to continue working.
at line 199
Collection
terminatingProcesses()
Get the processes that are still terminating.
at line 209
void
pruneTerminatingProcesses()
Remove any non-running processes from the terminating process list.
at line 223
protected void
stopTerminatingProcessesThatAreHanging()
Stop any terminating processes that are hanging too long.
at line 237
Collection
processes()
Get all of the current processes as a collection.
at line 245
Collection
runningProcesses()
Get all of the current running processes as a collection.
at line 259
int
totalProcessCount()
Get the total active process count, including processes pending termination.
at line 267
string
queue()
The name of the queue(s) being worked by the pool.
at line 275
int
count()
Count the total number of processes in the pool.