-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading a file throws error or hangs #5
Comments
Hmm interesting, I'll take a look at his, I've seen odd behavior with reading multiple files at the same time before but never tried to nail it down before because it occurred randomly. I'll give this code a shot locally and see what happens 👍 . |
Hello @WyriHaximus ! public function getContents()
{
return $this->open('r')->then(function ($stream) {
/** @var ReadableStreamInterface $stream */
$stream->once('end', function () use ($stream) { $stream->close(); });
return Stream\buffer($stream)->always(function () {
$this->close();
});
});
} |
IIRC I fixed this locally but was hunting down some other errors popping up. I'll try to work on this during the weekend. |
This can be also an issue from React\Promise\Stream::buffer function, there is no handling of 'end' event and that is strange ^_^ |
FYI my WIP changes: master...WyriHaximus-labs:fix-test-chown-uid |
Thanks a lot, will use as temporary solution up to next update 😃 |
Got a bit further, everything runs without issues on PHP 5 and 7 locally. So I'm currently debugging permission issues on travis |
Nearly fixed all issues: https://travis-ci.org/WyriHaximus-labs/filesystem/builds/378239247 Once done I'll file a bunch of PR's for all fixes 🎉 |
Gave up and marked |
With the following code:
The output should be something along the lines of:
But sometimes the
Eio
throws an unknown errorOr one or both reads hangs forever
Every time I run the script I got one of the results randomly(?). I'm running Ubuntu 14.04.1 LTS.
@WyriHaximus, do you have an idea of what may be causing the problem?
The text was updated successfully, but these errors were encountered: