-
Notifications
You must be signed in to change notification settings - Fork 227
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
Simpler stream construction #108
Conversation
One thing that will be a prerequisite before this gets merged is to put in the work to reverse the flow of readable-stream into io.js. |
@@ -121,6 +121,9 @@ function Readable(options) { | |||
// legacy | |||
this.readable = true; | |||
|
|||
if (options && util.isFunction(options.read)) | |||
this._read = options.read; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm -0 on adding this if it's a shorthand for _read = fn
– accepting functions into the constructor is a natural jumping off point for the other changes we'd like to see with streams, and if we don't take that opportunity when we add this functionality we'll have lost the chance to do so in the future (this roughly echoes my position from the other issue.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh so you were suggest jump straight to 'start' & 'pull'?
That's fine, it was more like a rough here's what I was suggesting, let's discuss. I don't think it is necessarily the final solution. |
It's definitely best if we do this properly so we are all in agreement, I am just keen to prompt discussion. |
Per the WG meeting: everyone was pretty much +1 on this going in if the keys for _transform and _write don't conflict with WHATWG-style keys. |
@chrisdickinson cool, well I'll wait for @domenic to come back with some feedback before writing some simple tests. As you know I have raised some questions in (#102) maybe they were your initial concerns before? |
OK, so basically the semantics are compatible in all cases. (Except readable streams, but we dodge that by using In general the parameters don't match up, even ignoring the promise/callback issues. So people won't be able to transparently swap out So, +1 to proceed. |
@domenic @chrisdickinson awesome things for the update, I will knock up some tests and raised as a PR in iojs/io.js also. |
This is in core, so I am going to close |
This is a PR to support suggested functionality discussed in issue #102 to be discussed at WG Meeting: #106
(Subsequent changes will likely be rebased into one commit)
Please review - Do Not Merge