2016-08-22 06:40:48 +02:00
|
|
|
<?php declare(strict_types = 1);
|
2016-08-21 17:33:39 +02:00
|
|
|
|
2016-08-23 23:47:40 +02:00
|
|
|
namespace Amp\Parallel\Worker\Internal;
|
2016-08-21 17:33:39 +02:00
|
|
|
|
2016-08-23 23:47:40 +02:00
|
|
|
use Amp\Parallel\Worker\Task;
|
2016-08-21 17:33:39 +02:00
|
|
|
|
|
|
|
class Job {
|
|
|
|
/** @var string */
|
|
|
|
private $id;
|
|
|
|
|
2016-08-23 23:47:40 +02:00
|
|
|
/** @var \Amp\Parallel\Worker\Task */
|
2016-08-21 17:33:39 +02:00
|
|
|
private $task;
|
|
|
|
|
|
|
|
public function __construct(Task $task) {
|
|
|
|
$this->task = $task;
|
|
|
|
$this->id = \spl_object_hash($this->task);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getId(): string {
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTask(): Task {
|
|
|
|
return $this->task;
|
|
|
|
}
|
|
|
|
}
|