2016-12-29 19:16:04 -06:00
|
|
|
<?php
|
2015-12-16 11:16:21 -06:00
|
|
|
|
2016-08-23 16:47:40 -05:00
|
|
|
namespace Amp\Parallel\Test\Worker;
|
2016-08-18 11:04:48 -05:00
|
|
|
|
2017-05-18 09:51:31 +02:00
|
|
|
use Amp\Parallel\Worker\DefaultPool;
|
|
|
|
use Amp\Parallel\Worker\WorkerFactory;
|
|
|
|
use Amp\Parallel\Worker\WorkerProcess;
|
2015-12-16 11:16:21 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @group process
|
|
|
|
*/
|
2016-08-18 17:36:58 -05:00
|
|
|
class ProcessPoolTest extends AbstractPoolTest {
|
|
|
|
protected function createPool($min = null, $max = null) {
|
|
|
|
$factory = $this->createMock(WorkerFactory::class);
|
2015-12-16 11:16:21 -06:00
|
|
|
$factory->method('create')->will($this->returnCallback(function () {
|
2016-08-22 18:25:19 -05:00
|
|
|
return new WorkerProcess;
|
2015-12-16 11:16:21 -06:00
|
|
|
}));
|
|
|
|
|
|
|
|
return new DefaultPool($min, $max, $factory);
|
|
|
|
}
|
|
|
|
}
|