# 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

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

## 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

- Pool::collect — Collect references to completed tasks
- Pool::__construct — Creates a new Pool of Workers
- Pool::resize — Resize the Pool
- Pool::shutdown — Shutdown all workers
- Pool::submit — Submits an object for execution
- Pool::submitTo — Submits a task to a specific worker for execution

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open