GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
Pool Class Reference

Public Member Functions

 __construct ($size, $class, $ctor=[])
 
 collect (callable $collector)
 
 resize ($size)
 
 shutdown ()
 
 submit (Threaded $task)
 
 submitTo ($worker, Threaded $task)
 

Protected Attributes

 $size
 
 $class
 
 $workers
 
 $ctor
 
 $last
 

Detailed Description

Pool class

A Pool is a container for, and controller of, a number of Worker threads, the number of threads can be adjusted during execution, additionally the Pool provides an easy mechanism to maintain and collect references in the proper way.

http://www.php.net/manual/en/class.pool.php

Constructor & Destructor Documentation

◆ __construct()

__construct (   $size,
  $class,
  $ctor = [] 
)

Construct a new Pool of Workers

Parameters
integer$sizeThe maximum number of Workers this Pool can create
string | null$classThe class for new Workers
array | null$ctorAn array of arguments to be passed to new Workers

http://www.php.net/manual/en/pool.__construct.php

429 {}

Member Function Documentation

◆ collect()

collect ( callable  $collector)

Collect references to completed tasks

Allows the Pool to collect references determined to be garbage by the given collector

Parameters
callable$collectorhttp://www.php.net/manual/en/pool.collect.php
440 {}

◆ resize()

resize (   $size)

Resize the Pool

Parameters
integer$sizeThe maximum number of Workers this Pool can create

http://www.php.net/manual/en/pool.resize.php

449 {}

◆ shutdown()

shutdown ( )

Shutdown all Workers in this Pool

http://www.php.net/manual/en/pool.shutdown.php

456 {}

◆ submit()

submit ( Threaded  $task)

Submit the task to the next Worker in the Pool

Parameters
Threaded$taskThe task for execution
Returns
int the identifier of the Worker executing the object
465 {}

◆ submitTo()

submitTo (   $worker,
Threaded  $task 
)

Submit the task to the specific Worker in the Pool

Parameters
int$workerThe worker for execution
Threaded$taskThe task for execution
Returns
int the identifier of the Worker that accepted the object
475 {}

Field Documentation

◆ $class

$class
protected

◆ $ctor

$ctor
protected

◆ $last

$last
protected

◆ $size

$size
protected

◆ $workers

$workers
protected

The documentation for this class was generated from the following file: