1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-02 17:52:14 +01:00
parallel/lib/Worker/WorkerFork.php
2016-08-21 23:40:48 -05:00

20 lines
496 B
PHP

<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker;
use Amp\Concurrent\Forking\Fork;
use Amp\Concurrent\Worker\Internal\TaskRunner;
use Interop\Async\Awaitable;
/**
* A worker thread that executes task objects.
*/
class WorkerFork extends AbstractWorker {
public function __construct() {
parent::__construct(new Fork(function (): Awaitable {
$runner = new TaskRunner($this, new BasicEnvironment);
return $runner->run();
}));
}
}