PHP Класс Icicle\Concurrent\Worker\Pool

A worker pool is a collection of worker threads that can perform multiple tasks simultaneously. The load on each worker is balanced such that tasks are completed as soon as possible and workers are used efficiently.
Наследование: implements Icicle\Concurrent\Worker\PoolInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
get ( ) : Worker Gets a worker from the pool. The worker is marked as busy and will only be reused if the pool runs out of idle workers. The worker will be automatically marked as idle once no references to the returned worker remain.
getIdleWorkerCount ( ) : integer Gets the number of workers that are currently idle.
getMaxSize ( ) : integer Gets the maximum number of workers the pool may spawn to handle concurrent tasks.
getMinSize ( ) : integer Gets the minimum number of workers the pool may have idle.
getWorkerCount ( ) : integer Gets the number of workers currently running in the pool.

Описание методов

get() публичный Метод

Gets a worker from the pool. The worker is marked as busy and will only be reused if the pool runs out of idle workers. The worker will be automatically marked as idle once no references to the returned worker remain.
public get ( ) : Worker
Результат Worker

getIdleWorkerCount() публичный Метод

Gets the number of workers that are currently idle.
public getIdleWorkerCount ( ) : integer
Результат integer The number of idle workers.

getMaxSize() публичный Метод

Gets the maximum number of workers the pool may spawn to handle concurrent tasks.
public getMaxSize ( ) : integer
Результат integer The maximum number of workers.

getMinSize() публичный Метод

Gets the minimum number of workers the pool may have idle.
public getMinSize ( ) : integer
Результат integer The minimum number of workers.

getWorkerCount() публичный Метод

Gets the number of workers currently running in the pool.
public getWorkerCount ( ) : integer
Результат integer The number of workers.