pthreads
PHP Manual

The Pool class

(PECL pthreads >= 2.0.0)

Einführung

A Pool is a container for, and controller of, an adjustable number of Workers.

Pooling provides a higher level abstraction of the Worker functionality, including the management of references in the way required by pthreads.

Klassenbeschreibung

Pool {
/* Eigenschaften */
protected $size ;
protected $class ;
protected $workers ;
protected $ctor ;
protected $last ;
/* Methoden */
public int collect ([ Callable $collector ] )
public Pool __construct ( int $size [, string $class [, array $ctor ]] )
public void resize ( int $size )
public void shutdown ( void )
public int submit ( Threaded $task )
public int submitTo ( int $worker , Threaded $task )
}

Eigenschaften

size

maximum number of Workers this Pool can use

class

the class of the Worker

workers

references to Workers

ctor

the arguments for constructor of new Workers

last

offset in workers of the last Worker used

Inhaltsverzeichnis


pthreads
PHP Manual