2015-08-14 19:25:07 +02:00
|
|
|
<?php
|
|
|
|
namespace Icicle\Concurrent\Worker;
|
|
|
|
|
|
|
|
/**
|
2015-12-05 06:50:32 +01:00
|
|
|
* An interface for worker pools.
|
2015-08-14 19:25:07 +02:00
|
|
|
*/
|
2015-12-05 06:50:32 +01:00
|
|
|
interface Pool extends Worker
|
2015-08-14 19:25:07 +02:00
|
|
|
{
|
2015-08-29 03:30:53 +02:00
|
|
|
/**
|
2015-12-05 06:50:32 +01:00
|
|
|
* Gets the number of workers currently running in the pool.
|
2015-08-28 05:51:50 +02:00
|
|
|
*
|
2015-12-05 06:50:32 +01:00
|
|
|
* @return int The number of workers.
|
2015-08-28 05:51:50 +02:00
|
|
|
*/
|
2015-12-05 06:50:32 +01:00
|
|
|
public function getWorkerCount();
|
2015-08-28 05:51:50 +02:00
|
|
|
|
|
|
|
/**
|
2015-12-05 06:50:32 +01:00
|
|
|
* Gets the number of workers that are currently idle.
|
2015-08-28 05:51:50 +02:00
|
|
|
*
|
2015-12-05 06:50:32 +01:00
|
|
|
* @return int The number of idle workers.
|
2015-08-28 05:51:50 +02:00
|
|
|
*/
|
2015-12-05 06:50:32 +01:00
|
|
|
public function getIdleWorkerCount();
|
2015-08-14 19:25:07 +02:00
|
|
|
}
|