1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 10:07:49 +01:00
parallel/lib/Worker/WorkerThread.php
2016-11-14 17:43:44 -06:00

20 lines
494 B
PHP

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