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

20 lines
437 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-08-27 09:10:08 -05:00
class WorkerThread extends Worker
{
public function __construct()
{
2015-08-27 09:10:08 -05:00
parent::__construct(new Thread(function () {
2015-09-09 23:29:41 -05:00
$runner = new TaskRunner($this, new Environment());
2015-08-27 09:10:08 -05:00
yield $runner->run();
}));
}
}