1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-23 06:21:12 +01:00
parallel/lib/Worker/WorkerThread.php

20 lines
477 B
PHP
Raw Normal View History

<?php
2016-08-18 11:04:48 -05:00
namespace Amp\Concurrent\Worker;
use Amp\Concurrent\Threading\Thread;
use Amp\Concurrent\Worker\Internal\TaskRunner;
use Interop\Async\Awaitable;
/**
* A worker thread that executes task objects.
*/
2016-08-18 11:04:48 -05:00
class WorkerThread extends AbstractWorker {
public function __construct() {
parent::__construct(new Thread(function (): Awaitable {
$runner = new TaskRunner($this, new BasicEnvironment);
return $runner->run();
2015-08-27 09:10:08 -05:00
}));
}
}