a-blog cms PHP API Reference

ProcessPool
in package

FinalYes

並列数を制御しつつ、複数の ProcessTask を実行するプール。 停止要求時は新規タスクを起動せず、実行中プロセスを強制終了して安全に終了する。

Table of Contents

Properties

$errorHandler  : ErrorHandlerInterface
$maxParallel  : int
$queue  : SplQueue<string|int, ProcessTask>
$responseHandler  : ResponseHandlerInterface
$runner  : ProcOpenRunner
$running  : array<int, RunningProcess>
$stopRequested  : bool
$taskStartHandler  : TaskStartHandlerInterface

Methods

__construct()  : mixed
addTask()  : void
getQueuedTaskCount()  : int
キューに残っている未実行タスクの数。
isStopRequested()  : bool
停止が要求されているかどうか。
requestStop()  : void
停止を要求する。 呼び出し後、新規タスクは起動されず、実行中プロセスは強制終了され、 run() は残り結果を返して終了する。
run()  : array<int, mixed>
全タスクを実行し、ハンドラの戻り値を配列で返す。 requestStop() により停止した場合は、強制終了されたプロセスは errorHandler で処理される。

Properties

$running

private array<int, RunningProcess> $running = []

Methods

getQueuedTaskCount()

キューに残っている未実行タスクの数。

public getQueuedTaskCount() : int
Return values
int

isStopRequested()

停止が要求されているかどうか。

public isStopRequested() : bool
Return values
bool

requestStop()

停止を要求する。 呼び出し後、新規タスクは起動されず、実行中プロセスは強制終了され、 run() は残り結果を返して終了する。

public requestStop() : void

run()

全タスクを実行し、ハンドラの戻り値を配列で返す。 requestStop() により停止した場合は、強制終了されたプロセスは errorHandler で処理される。

public run() : array<int, mixed>
Return values
array<int, mixed>

        
On this page

Search results