Skip to content
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

add stream_set_blocking for objects of type stream to limit boilerplate #9

Merged
merged 4 commits into from
Sep 2, 2014

Conversation

steverhoades
Copy link
Contributor

for creating non-blocking io.

Decided to add a PR for this after talking with @cboden on IRC. It seems like it would be beneficial to have Stream always set stream_set_blocking for all stream types.

This would eliminate the need for:
https://github.com/reactphp/socket/blob/master/src/Server.php#L46

as Connection is of type Stream and the construction occurs:
https://github.com/reactphp/socket/blob/master/src/Server.php#L69

The benefit of this is that we can now do things like this:

$stream = new \React\Stream\Stream(fopen('myfile.txt', 'r'), $loop);

@steverhoades steverhoades changed the title add stream_set_blocking for of type stream to limit boilerplate add stream_set_blocking for objects of type stream to limit boilerplate Aug 30, 2014
@steverhoades
Copy link
Contributor Author

Also, if this PR is accepted then #8 can be closed.

@cboden cboden added this to the v0.4.2 milestone Sep 2, 2014
@cboden cboden unassigned igorw Sep 2, 2014
cboden added a commit that referenced this pull request Sep 2, 2014
add stream_set_blocking for  objects of type stream to limit boilerplate
@cboden cboden merged commit 3edf337 into reactphp:master Sep 2, 2014
@cboden cboden mentioned this pull request Sep 2, 2014
@steverhoades steverhoades deleted the stream-nonblock branch September 3, 2014 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants