1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-11 16:49:51 +01:00
parallel/lib/Worker/Internal/TaskSuccess.php

21 lines
411 B
PHP
Raw Normal View History

2016-12-30 02:16:04 +01:00
<?php
2016-08-23 23:47:40 +02:00
namespace Amp\Parallel\Worker\Internal;
use Amp\Success;
use Amp\Promise;
2016-09-07 18:38:46 +02:00
class TaskSuccess extends TaskResult {
/** @var mixed Result of task. */
private $result;
public function __construct(string $id, $result) {
2016-09-07 18:38:46 +02:00
parent::__construct($id);
$this->result = $result;
}
2016-11-15 00:43:44 +01:00
public function promise(): Promise {
return new Success($this->result);
}
}