Files
parallel/test/Worker/ThreadWorkerTest.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

26 lines
682 B
PHP

<?php declare(strict_types=1);
namespace Amp\Parallel\Test\Worker;
use Amp\Parallel\Context\ThreadContext;
use Amp\Parallel\Context\ThreadContextFactory;
use Amp\Parallel\Worker\ContextWorkerFactory;
use Amp\Parallel\Worker\Worker;
class ThreadWorkerTest extends AbstractWorkerTest
{
protected function createWorker(?string $autoloadPath = null): Worker
{
if (!ThreadContext::isSupported()) {
$this->markTestSkipped('ext-parallel required');
}
$factory = new ContextWorkerFactory(
bootstrapPath: $autoloadPath,
contextFactory: new ThreadContextFactory(),
);
return $factory->create();
}
}