Skip to content

Update react/stream to support 0.7.2 and future 1.x - #38

Merged
WyriHaximus merged 1 commit into
reactphp:masterfrom
WyriHaximus-labs:upgrade-react-stream
Jun 18, 2017
Merged

Update react/stream to support 0.7.2 and future 1.x#38
WyriHaximus merged 1 commit into
reactphp:masterfrom
WyriHaximus-labs:upgrade-react-stream

Conversation

@WyriHaximus

@WyriHaximusWyriHaximus commented Jun 12, 2017

Copy link
Copy Markdown
Member

Supersedes / closes#35
Implements / closes#37
Implements / closes#30

Comment threadsrc/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]);

Copy link
Copy Markdown
MemberAuthor

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

@clueclue left a comment

Copy link
Copy Markdown
Member

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 👍

Comment threadsrc/Process.php Outdated
if (is_resource($that->pipes[0])) {
fclose($that->pipes[0]);
}
});

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
MemberAuthor

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 👍

Copy link
Copy Markdown
MemberAuthor

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.

@clueclue changed the title Update react/stream to support 0.6, 0.7, and 1.xUpdate react/stream to support 0.7.2 and future 1.xJun 16, 2017

@clueclue left a comment

Copy link
Copy Markdown
Member

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.

@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

Change LGTM, but the README could use an update 👍

Yeah I'm working on that 👍

@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

Ping @reactphp/core updated the readme 😎

Comment threadREADME.md Outdated

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`.

Copy link
Copy Markdown
Member

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?

Comment threadREADME.md Outdated
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)

Copy link
Copy Markdown
Member

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.

Comment threadREADME.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).

Copy link
Copy Markdown
Member

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.

WyriHaximus added a commit to WyriHaximus-labs/child-process that referenced this pull request Jun 17, 2017
WyriHaximus added a commit to WyriHaximus-labs/child-process that referenced this pull request Jun 17, 2017

@clueclue left a comment

Copy link
Copy Markdown
Member

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 👍

@WyriHaximusWyriHaximus added this to the v0.5.0 milestone Jun 17, 2017
@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

@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
@WyriHaximus
WyriHaximusforce-pushed the upgrade-react-stream branch from ff3828a to 4ef64e9CompareJune 17, 2017 16:39
@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

Squash commits 😎

@clueclue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! :shipit:

@WyriHaximus
WyriHaximus merged commit 5d0047f into reactphp:masterJun 18, 2017
@clueclue mentioned this pull request Jan 13, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update stream dependency to 0.7 STDIO streams should be readable or writable, but not duplex

3 participants

@WyriHaximus@jsor@clue