mirror of
https://github.com/danog/parallel.git
synced 2025-01-07 13:18:22 +01:00
20 lines
379 B
PHP
20 lines
379 B
PHP
<?php
|
|
namespace Icicle\Tests\Concurrent\Worker;
|
|
|
|
use Icicle\Concurrent\Worker\{Environment, Task};
|
|
|
|
class TestTask implements Task
|
|
{
|
|
private $returnValue;
|
|
|
|
public function __construct($returnValue)
|
|
{
|
|
$this->returnValue = $returnValue;
|
|
}
|
|
|
|
public function run(Environment $environment): \Generator
|
|
{
|
|
return yield $this->returnValue;
|
|
}
|
|
}
|