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

29 lines
623 B
PHP
Raw Normal View History

2016-08-22 06:40:48 +02:00
<?php declare(strict_types = 1);
2016-08-23 23:47:40 +02:00
namespace Amp\Parallel\Worker\Internal;
2016-11-15 00:43:44 +01:00
use Interop\Async\Promise;
2016-09-07 18:38:46 +02:00
abstract class TaskResult {
/** @var string Task identifier. */
private $id;
/**
* @param string $id Task identifier.
*/
public function __construct(string $id) {
$this->id = $id;
}
/**
* @return string Task identifier.
*/
2016-09-07 18:38:46 +02:00
public function getId(): string {
return $this->id;
}
/**
2016-11-15 00:43:44 +01:00
* @return \Interop\Async\Promise<mixed> Resolved with the task result or failure reason.
*/
2016-11-15 00:43:44 +01:00
abstract public function promise(): Promise;
}