PHP Class 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.
Inheritance: implements Icicle\Concurrent\Worker\PoolInterface
Afficher le fichier Open project: icicleio/concurrent Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

get() public méthode

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
Résultat Worker

getIdleWorkerCount() public méthode

Gets the number of workers that are currently idle.
public getIdleWorkerCount ( ) : integer
Résultat integer The number of idle workers.

getMaxSize() public méthode

Gets the maximum number of workers the pool may spawn to handle concurrent tasks.
public getMaxSize ( ) : integer
Résultat integer The maximum number of workers.

getMinSize() public méthode

Gets the minimum number of workers the pool may have idle.
public getMinSize ( ) : integer
Résultat integer The minimum number of workers.

getWorkerCount() public méthode

Gets the number of workers currently running in the pool.
public getWorkerCount ( ) : integer
Résultat integer The number of workers.