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

Consistent end event semantics (EOF) #70

Merged
merged 1 commit into from
Mar 5, 2017
Merged

Conversation

clue
Copy link
Member

@clue clue commented Mar 3, 2017

An end event will (only) be emitted when the stream/connection reached EOF (end of file or other side closes the connection)

This is potentially a BC break for anybody who relied on the existing inconsistent(!) behavior, where the end was usually(!) emitted right before a close event. Consumers should use the unchanged close event in this case.

Closes #59

@clue clue added this to the v0.5.0 milestone Mar 3, 2017

// reject because this is not an end() and clear buffer
$this->buffer = '';
$this->deferred->reject(new \RuntimeException('Closed without ending'));
Copy link
Member Author

Choose a reason for hiding this comment

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

Let me revert this change to keep this diff smaller 👎

I'd rather not change the BufferedSink at all, it will likely be removed via #45 anyway.

@clue
Copy link
Member Author

clue commented Mar 5, 2017

Updated to only affect end event behavior and not the BufferedSink otherwise :shipit:

@clue clue merged commit 4901524 into reactphp:master Mar 5, 2017
@clue clue deleted the end-event branch March 5, 2017 12:56
Sign up for free to 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.

Inaccurate end event semantics
3 participants