mirror of
https://github.com/danog/parallel.git
synced 2024-11-30 04:39:01 +01:00
21 lines
535 B
PHP
21 lines
535 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel\Test\Worker;
|
|
|
|
use Amp\Parallel\Worker\{ DefaultPool, WorkerFactory, WorkerThread };
|
|
|
|
/**
|
|
* @group threading
|
|
* @requires extension pthreads
|
|
*/
|
|
class ThreadPoolTest extends AbstractPoolTest {
|
|
protected function createPool($min = null, $max = null) {
|
|
$factory = $this->createMock(WorkerFactory::class);
|
|
$factory->method('create')->will($this->returnCallback(function () {
|
|
return new WorkerThread;
|
|
}));
|
|
|
|
return new DefaultPool($min, $max, $factory);
|
|
}
|
|
}
|