-
-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Labels
Milestone
Description
I am not sure if this is actually an issue, but if you pipe from a stream that has already reached EOF (or closed some other way) pipe will cause the loop to never exit because no events are sent - or will ever be sent - to the destination stream.
It seems that it would be better for pipe to close the destination stream if isReadable
is false.
Reproduce:
<?php
require_once __DIR__ . '/vendor/autoload.php';
system('echo Testing > somefile.txt');
$loop = \React\EventLoop\Factory::create();
$readStream = new \React\Stream\Stream(fopen("somefile.txt", "r"), $loop);
$loop->addTimer(1, function () use ($loop, $readStream) {
$output = new \React\Stream\Stream(STDOUT, $loop);
$readStream->pipe($output);
});
$loop->run();