-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Update react/stream to support 0.7.2 and future 1.x #38
Update react/stream to support 0.7.2 and future 1.x #38
Conversation
src/Process.php
Outdated
$this->stdin = new WritableResourceStream($this->pipes[0], $loop); | ||
$this->stdin->on('close', function () { | ||
if (is_resource($this->pipes[0])) { | ||
fclose($this->pipes[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is needed until reactphp/stream#107 is merged and tagged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README probably also needs an update, otherwise LGTM 👍
src/Process.php
Outdated
if (is_resource($that->pipes[0])) { | ||
fclose($that->pipes[0]); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is work around for reactphp/stream#107? Does it make sense to back port this to older stream release and only target fixed versions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is, made a comment on it after making the PR #38 (comment) and that makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed the code removing this and going 0.7.2 and up with react/stream
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM, but the README could use an update 👍
For the reference: The unrelated HHVM build error is being addressed via #39.
Yeah I'm working on that 👍 |
Ping @reactphp/core updated the readme 😎 |
README.md
Outdated
@@ -64,16 +64,16 @@ access fields otherwise available through `proc_get_status()`. | |||
### Stream Properties | |||
|
|||
Once a process is started, its I/O streams will be constructed as instances of | |||
`React\Stream\Stream`. Before `start()` is called, these properties are `null`. | |||
`React\Stream\ReadableResourceStream` as `React\Stream\WritableResourceStream`. Before `start()` is called, these properties are `null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as -> and
Also, should we use ReadableStreamInterface
and WritableStreamInterface
instead of the concrete implementations?
README.md
Outdated
Once a process terminates, the streams will become closed but not unset. | ||
|
||
* `$stdin` | ||
* `$stdout` | ||
* `$stderr` | ||
|
||
Each of these implement the underlying | ||
[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface) | ||
and you can use any of its events and methods as usual: | ||
[`ReadableResourceStream`](https://github.com/reactphp/stream#readablestreaminterface) or [`WritableResourceStream`](https://github.com/reactphp/stream#writablestreaminterface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment about ReadableStreamInterface
and WritableStreamInterface
. If we mention the concrete implementations, we should probably also link to their docs (eg. https://github.com/reactphp/stream#readableresourcestream) instead of the interface docs.
README.md
Outdated
// … | ||
``` | ||
|
||
For more details, see the | ||
[`DuplexStreamInterface`](https://github.com/reactphp/stream#duplexstreaminterface). | ||
[`ReadableResourceStream`](https://github.com/reactphp/stream#readablestreaminterface) and [`WritableResourceStream`](https://github.com/reactphp/stream#writablestreaminterface). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comments about ReadableStreamInterface
and WritableStreamInterface
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README could use some line wraps and the commits should be squashed to a reasonable number, otherwise LGTM 👍
@clue wrapped the lines. Squashing in a moment 😎 |
PHP 5.3 fix Updated to react/stream:^0.7.2 Removed unused React\Stream\Stream import Updated readme to the updated streams As => and reactphp#38 (comment) Use interfaces instead of concrete classes in the documentation reactphp#38 (comment) Line folding
ff3828a
to
4ef64e9
Compare
Squash commits 😎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
Supersedes / closes #35
Implements / closes #37
Implements / closes #30