1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00

Return PID from Process::start()

This commit is contained in:
Aaron Piotrowski 2018-11-04 11:34:18 -06:00
parent c774d2ded1
commit 596f41886b
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -190,6 +190,8 @@ final class Process implements Context
yield $this->process->getStdin()->write($this->hub->generateKey($pid, self::KEY_LENGTH));
$this->channel = yield $this->hub->accept($pid);
return $pid;
} catch (\Throwable $exception) {
$this->process->kill();
throw new ContextException("Staring the process failed", 0, $exception);