Steps to reproduce behavior
1. create file
php -r 'foreach(range(0, 1000000) as $i) { print $i . PHP_EOL; }' > static/test.txt
2. create script
<?php
use \React\Promise\Deferred;
$loader = require __DIR__ . '/vendor/autoload.php';
#$loop = React\EventLoop\Factory::create();
$loop = new React\EventLoop\ExtEvLoop();
$filesystem = \React\Filesystem\Filesystem::create($loop);
$file = $filesystem->file('static/test.txt');
$file->exists()
->then(function () use ($file) {
return $file->open('r');
})
->then(function ($stream) use ($loop) {
$d = new Deferred();
$stream->on('data', function ($data) {
print $data;
});
$stream->on('end', function ($data) use ($stream, $d) {
$stream->close();
$d->resolve('finish');
});
return $d->promise();
})
->then(function () use ($loop) {
$loop->stop();
})
->otherwise(function ($e) {
var_dump($e);
});
$loop->run();
3. run
php7.3 3.php
0
1
2
3
...
375148
375149
3751root@7cf1e7fada2c:/app/adv#
if you change the adapter to child process then everything works well
Steps to reproduce behavior
1. create file
2. create script
3. run
if you change the adapter to child process then everything works well