mirror of
https://github.com/amphp/parallel.git
synced 2025-03-15 07:29:48 +01:00
22 lines
629 B
PHP
22 lines
629 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Amp\Parallel\Test\Worker;
|
|
|
|
use Amp\Cancellation;
|
|
use Amp\Parallel\Context\Context;
|
|
use Amp\Parallel\Context\ContextFactory;
|
|
use Amp\Parallel\Context\ProcessContextFactory;
|
|
|
|
class ProcessPoolTest extends AbstractPoolTest
|
|
{
|
|
public function createContextFactory(): ContextFactory
|
|
{
|
|
return new class implements ContextFactory {
|
|
public function start(array|string $script, ?Cancellation $cancellation = null): Context
|
|
{
|
|
return (new ProcessContextFactory())->start($script, cancellation: $cancellation);
|
|
}
|
|
};
|
|
}
|
|
}
|