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 DuplexResourceStream and deprecate Stream #85

Merged
merged 3 commits into from
Mar 24, 2017

Conversation

clue
Copy link
Member

@clue clue commented Mar 24, 2017

The old Stream has been renamed to DuplexResourceStream to complement the ReadableResourceStream and WritableResourceStream introduced via #83 and #84.

Note that the DuplexResourceStream now rejects read-only or write-only streams, so this may affect BC. If you want a read-only or write-only resource, use ReadableResourceStream or WritableResourceStream instead of DuplexResourceStream.

Also marking this as a bug fix because the old behavior with regards to stream resource that were not opened in duplex mode could actually result in runtime errors.

The Stream class is one of the main classes in this package, so I've added a deprecated dummy Stream class that simply extends the new DuplexResourceStream for BC reasons only. This means that existing packages can keep using the Stream class for "normal" resources such as TCP/IP connections with this version. This class exists to ease upgrading only and will be removed in the next version.

If you want to review, consider looking at the individual commits, this should make this slightly more obvious.

Resolves / closes #37
Builds on top of #83 and #84.

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.

All streams are duplex (r/w) by default and can thus keep the loop running
3 participants