From 8ecfed57bfb258a219ddfa7ebaac453caf735bc4 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 23 Jun 2017 16:44:17 +0200 Subject: [PATCH] Unreference stderr reading, so it doesn't keep the loop running --- composer.json | 2 +- lib/Process/ChannelledProcess.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 489d3c9..50a5eb8 100755 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "amphp/amp": "^2", - "amphp/byte-stream": "^1", + "amphp/byte-stream": "^1.1", "amphp/parser": "^1", "amphp/process": "^0.2" }, diff --git a/lib/Process/ChannelledProcess.php b/lib/Process/ChannelledProcess.php index a0c3fda..7ea260d 100644 --- a/lib/Process/ChannelledProcess.php +++ b/lib/Process/ChannelledProcess.php @@ -67,7 +67,9 @@ class ChannelledProcess implements ProcessContext, Strand { $this->process->start(); $this->channel = new ChannelledStream($this->process->getStdout(), $this->process->getStdin()); + /** @var ByteStream\ResourceInputStream $childStderr */ $childStderr = $this->process->getStderr(); + $childStderr->unreference(); asyncCall(function () use ($childStderr) { $stderr = new ByteStream\ResourceOutputStream(\STDERR);