Files
parallel/test/Worker/DelegatingWorkerPoolTest.php
Aaron Piotrowski 7f8ca5472d
Some checks are pending
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, on Windows, windows-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, on macOS, macos-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.1) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.2) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (none, true, with ext-parallel, ubuntu-latest, parallel, ts, 8.2, none, none) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (none, true, with ext-parallel, ubuntu-latest, parallel, ts, 8.3, none, none) (push) Waiting to run
Add DelegatingWorkerPool
2024-09-01 09:40:09 -05:00

25 lines
742 B
PHP

<?php declare(strict_types=1);
namespace Amp\Parallel\Test\Worker;
use Amp\Parallel\Context\ProcessContextFactory;
use Amp\Parallel\Worker\ContextWorkerFactory;
use Amp\Parallel\Worker\ContextWorkerPool;
use Amp\Parallel\Worker\DelegatingWorkerPool;
use Amp\Parallel\Worker\WorkerPool;
class DelegatingWorkerPoolTest extends AbstractPoolTest
{
protected function createPool(
int $max = WorkerPool::DEFAULT_WORKER_LIMIT,
?string $autoloadPath = null,
): WorkerPool {
$pool = new ContextWorkerPool(
limit: $max * 2,
factory: new ContextWorkerFactory($autoloadPath, contextFactory: new ProcessContextFactory()),
);
return new DelegatingWorkerPool($pool, $max);
}
}