1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-02 17:52:14 +01:00
parallel/lib/Worker/WorkerThread.php
2017-03-16 17:03:59 -05:00

20 lines
457 B
PHP

<?php
namespace Amp\Parallel\Worker;
use Amp\Promise;
use Amp\Parallel\Threading\Thread;
use Amp\Parallel\Worker\Internal\TaskRunner;
/**
* 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();
}));
}
}