Consistent semantics for DuplexStreamInterface::end() to ensure it SHOULD also end readable side#86
Merged
jsor merged 2 commits intoreactphp:masterfrom Mar 26, 2017
Merged
Conversation
WyriHaximus
approved these changes
Mar 24, 2017
jsor
approved these changes
Mar 25, 2017
README.md
Outdated
|
|
||
| If this stream is a `DuplexStreamInterface`, calling this method SHOULD | ||
| also end its readable side, unless the stream supports half-open mode. | ||
| In other words, after calling this method, these stream SHOULD switch into |
src/WritableStreamInterface.php
Outdated
| * | ||
| * If this stream is a `DuplexStreamInterface`, calling this method SHOULD | ||
| * also end its readable side, unless the stream supports half-open mode. | ||
| * In other words, after calling this method, these stream SHOULD switch into |
Member
Author
|
Thanks for spotting, typos fixed and squashed |
jsor
approved these changes
Mar 26, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The semantics for this are currently not explicit and the
DuplexResourceStream(previouslyStream) class has a very unclearend()logic implemented. It currently turns the stream into non-readable mode but keeps emitting readable events despite.This PR ensures we use consistent semantics to ensure duplex streams SHOULD also end the readable side (unless this is a stream that supports half-open mode, see #27).
This should in fact not break any of the existing assumptions and as such should not be considered a BC break. Given that this current behavior was mostly underdocumented or undocumented, I'll mark this as a BC break just to be safe in case any implementation relies on undocumented features which might now be prohibited.
Builds on top of #72.