1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 14:01:14 +01:00
parallel/lib/Worker/Internal/TaskResult.php

29 lines
576 B
PHP
Raw Normal View History

2016-12-29 19:16:04 -06:00
<?php
2016-08-23 16:47:40 -05:00
namespace Amp\Parallel\Worker\Internal;
use Amp\Promise;
2016-09-07 11:38:46 -05: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 11:38:46 -05:00
public function getId(): string {
return $this->id;
}
/**
* @return \Amp\Promise<mixed> Resolved with the task result or failure reason.
*/
2016-11-14 17:43:44 -06:00
abstract public function promise(): Promise;
}