From 596f41886be45051f67d524605be350da5e885ac Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Sun, 4 Nov 2018 11:34:18 -0600 Subject: [PATCH] Return PID from Process::start() --- lib/Context/Process.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Context/Process.php b/lib/Context/Process.php index 64feba9..800a01b 100644 --- a/lib/Context/Process.php +++ b/lib/Context/Process.php @@ -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);