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
474 B
PHP
Raw Normal View History

<?php
namespace Icicle\Concurrent\Worker;
use Icicle\Concurrent\Threading\Thread;
2015-08-27 09:10:08 -05:00
use Icicle\Concurrent\Worker\Internal\TaskRunner;
/**
* A worker thread that executes task objects.
*/
2015-12-04 23:50:32 -06:00
class WorkerThread extends AbstractWorker
{
public function __construct()
{
2016-01-23 00:00:56 -06:00
parent::__construct(new Thread(function (): \Generator {
2016-01-14 17:44:43 -06:00
$runner = new TaskRunner($this, new BasicEnvironment());
2016-01-23 00:00:56 -06:00
return yield from $runner->run();
2015-08-27 09:10:08 -05:00
}));
}
}