mirror of
https://github.com/danog/parallel.git
synced 2024-11-27 04:44:56 +01:00
22 lines
420 B
PHP
22 lines
420 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel\Worker\Internal;
|
|
|
|
use Amp\Promise;
|
|
use Amp\Success;
|
|
|
|
/** @internal */
|
|
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);
|
|
}
|
|
}
|