1 | <?php |
||
12 | class ParallelProcess implements Runnable |
||
13 | { |
||
14 | protected $process; |
||
15 | protected $binary = Pool::DEFAULT_PHP_BINARY; |
||
16 | protected $task; |
||
17 | protected $id; |
||
18 | protected $pid; |
||
19 | |||
20 | protected $output; |
||
21 | protected $errorOutput; |
||
22 | |||
23 | protected $startTime; |
||
24 | |||
25 | private $outputLength; |
||
26 | |||
27 | use ProcessCallbacks; |
||
28 | |||
29 | public function __construct(callable $task, Process $process, int $id, ?int $outputLength) |
||
36 | |||
37 | public static function create(callable $task, Process $process, int $id, ?int $outputLength): self |
||
41 | |||
42 | public function start(): self |
||
52 | |||
53 | public function stop(): self |
||
59 | |||
60 | public function withBinary(string $binary = Pool::DEFAULT_PHP_BINARY): self |
||
67 | |||
68 | public function isRunning(): bool |
||
72 | |||
73 | public function isSuccessful(): bool |
||
77 | |||
78 | public function isTerminated(): bool |
||
82 | |||
83 | public function getOutput() |
||
97 | |||
98 | public function getErrorOutput() |
||
112 | |||
113 | public function getProcess(): Process |
||
117 | |||
118 | public function getId(): int |
||
122 | |||
123 | public function getPid(): ?int |
||
127 | |||
128 | public function getCurrentExecutionTime(): float |
||
132 | |||
133 | protected function resolveErrorOutput(): Throwable |
||
147 | } |
||
148 |