PHP 클래스 Pool, ClearSky

파일 보기 프로젝트 열기: robske110/ClearSky 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$class string The name of the Worker class for this Pool
$ctor array The constructor arguments to be passed by this Pool to new Workers upon construction
$last integer The numeric identifier for the last Worker used by this Pool
$size integer The maximum number of Worker threads allowed in this Pool
$workers array | Worker[] The array of Worker threads for this Pool

공개 메소드들

메소드 설명
__construct ( integer $size, string | null $class, array | null $ctor = [] ) Construct a new Pool of Workers
collect ( callable $collector ) Collect references to completed tasks
resize ( integer $size ) Resize the Pool
shutdown ( ) Shutdown all Workers in this Pool
submit ( Threaded $task ) : integer Submit the task to the next Worker in the Pool
submitTo ( integer $worker, Threaded $task ) : integer Submit the task to the specific Worker in the Pool

메소드 상세

__construct() 공개 메소드

Construct a new Pool of Workers
public __construct ( integer $size, string | null $class, array | null $ctor = [] )
$size integer The maximum number of Workers this Pool can create
$class string | null The class for new Workers
$ctor array | null An array of arguments to be passed to new Workers

collect() 공개 메소드

Allows the Pool to collect references determined to be garbage by the given collector
public collect ( callable $collector )
$collector callable

resize() 공개 메소드

Resize the Pool
public resize ( integer $size )
$size integer The maximum number of Workers this Pool can create

shutdown() 공개 메소드

Shutdown all Workers in this Pool
public shutdown ( )

submit() 공개 메소드

Submit the task to the next Worker in the Pool
public submit ( Threaded $task ) : integer
$task Threaded The task for execution
리턴 integer the identifier of the Worker executing the object

submitTo() 공개 메소드

Submit the task to the specific Worker in the Pool
public submitTo ( integer $worker, Threaded $task ) : integer
$worker integer The worker for execution
$task Threaded The task for execution
리턴 integer the identifier of the Worker that accepted the object

프로퍼티 상세

$class 보호되어 있는 프로퍼티

The name of the Worker class for this Pool
protected string $class
리턴 string

$ctor 보호되어 있는 프로퍼티

The constructor arguments to be passed by this Pool to new Workers upon construction
protected array $ctor
리턴 array

$last 보호되어 있는 프로퍼티

The numeric identifier for the last Worker used by this Pool
protected int $last
리턴 integer

$size 보호되어 있는 프로퍼티

The maximum number of Worker threads allowed in this Pool
protected int $size
리턴 integer

$workers 보호되어 있는 프로퍼티

The array of Worker threads for this Pool
protected array|Worker[] $workers
리턴 array | Worker[]