1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 10:07:49 +01:00
parallel/lib/Worker/Internal/TaskSuccess.php
2016-12-29 19:16:04 -06:00

21 lines
421 B
PHP

<?php
namespace Amp\Parallel\Worker\Internal;
use Amp\Success;
use Interop\Async\Promise;
class TaskSuccess extends TaskResult {
/** @var mixed Result of task. */
private $result;
public function __construct(string $id, $result) {
parent::__construct($id);
$this->result = $result;
}
public function promise(): Promise {
return new Success($this->result);
}
}