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 55
void
scale(int $processes)
Scale the process count.
at line 73
protected void
scaleUp(int $processes)
Scale up to the given number of processes.
at line 85
protected void
scaleDown(int $processes)
Scale down to the given number of processes.
at line 116
void
markForTermination(WorkerProcess $process)
Mark the given worker process for termination.
at line 126
protected void
removeProcesses(int $count)
Remove the given number of processes from the process array.
at line 134
protected ProcessPool
start()
Add a new worker process to the pool.
at line 146
protected WorkerProcess
createProcess()
Create a new process instance.
at line 161
void
monitor()
Evaluate the current state of all of the processes.
at line 169
void
restart()
Terminate all current workers and start fresh ones.
at line 181
void
pause()
Pause all of the worker processes.
at line 191
void
continue()
Instruct all of the worker processes to continue working.
at line 201
Collection
terminatingProcesses()
Get the processes that are still terminating.
at line 211
void
pruneTerminatingProcesses()
Remove any non-running processes from the terminating process list.
at line 225
protected void
stopTerminatingProcessesThatAreHanging()
Stop any terminating processes that are hanging too long.
at line 239
Collection
processes()
Get all of the current processes as a collection.
at line 247
Collection
runningProcesses()
Get all of the current running processes as a collection.
at line 261
int
totalProcessCount()
Get the total active process count, including processes pending termination.
at line 269
string
queue()
The name of the queue(s) being worked by the pool.
at line 277
int
count()
Count the total number of processes in the pool.