1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-12 00:59:46 +01:00
parallel/lib/Worker/WorkerFork.php
2016-12-29 19:16:04 -06:00

20 lines
459 B
PHP

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