1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 18:17:52 +01:00
parallel/lib/Worker/Internal/TaskSuccess.php

28 lines
573 B
PHP
Raw Normal View History

2016-08-22 06:40:48 +02:00
<?php declare(strict_types = 1);
namespace Amp\Concurrent\Worker\Internal;
use Amp\Success;
use Interop\Async\Awaitable;
class TaskSuccess implements TaskResult {
/** @var string */
private $id;
/** @var mixed Result of task. */
private $result;
public function __construct(string $id, $result) {
$this->id = $id;
$this->result = $result;
}
public function getId(): string {
return $this->id;
}
public function getAwaitable(): Awaitable {
return new Success($this->result);
}
}