From 4d83ffe1163443f2421094e8c619afec07a2b0e8 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 17 Apr 2015 12:08:53 +0200 Subject: [PATCH] Don't wait for a timer when the process already died --- src/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Process.php b/src/Process.php index 5fd28c1..609b99c 100644 --- a/src/Process.php +++ b/src/Process.php @@ -110,7 +110,7 @@ public function start(LoopInterface $loop, $interval = 0.1) return; } - $loop->addPeriodicTimer($interval, function (TimerInterface $timer) { + $loop->addPeriodicTimer($this->isRunning() ? $interval : 0, function (TimerInterface $timer) { if (!$this->isRunning()) { $this->close(); $timer->cancel();