-
Notifications
You must be signed in to change notification settings - Fork 147
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
Modifies pipe to pass along highland errors #191
Conversation
This involves: - Totally reimplementing stream redirection. - Reimplementing `consume`, `pull`, `fork`, and `resume`. Backward incompatible; - The stream no longer pauses if `next` isn't synchronously called in `consume`, since this is no longer necessary to signal (lack of) demand to the source. - Lots of methods and properties that start with `_` changed (these were private anyway). - The callback for the stream generator and `consume` is guaranteed not to be called a second time until `next` is called. Fixes: - caolan#41 - caolan#141 - caolan#142 - caolan#173
- Making brace style consistently follow Stroustrup - Cleaning up some small JSDoc blips - Moving a function declaration to outside a loop - A few minor things like semicolons, trailing commas and spaces, and empty blocks
Switch to ESLint.
@LewisJEllis can you explain the status on this ? I understand that this would be a breaking change in 2.x so this is a '3.0.0 potential' ? |
Yes; it's not a huge behavior change, but there definitely might be uses that this would break. I consider it ready to merge, but there haven't been any comments on the matter since the discussion in #136, so I've left it open. |
eece41a
to
e25f70c
Compare
Anyway we can get this backported to 2? I saw the discussion in #166 but I still think it's wrong expectation and at worse awkward that connecting two highland streams via pipe does not propagate errors. |
I agree it's silly, but simple of a change as it is, it strictly speaking is a non-BC as far as semver is concerned. I don't think we should merge it on 2.x, but there could be other options. |
Grumble, fair enough, might make a utility to do it then. -- On Mon, Mar 2, 2015 at 12:08 PM, Lewis J Ellis notifications@github.com
|
I agree it's not ideal but with the fix gone into |
@svozza use case is I want to pass a stream to a function and have it write to it.
Inside of
Is there a better way to do that? |
The point of streams is that you can construct the stream objects synchronously even if the data source isn't. What specifically requires you to ever write a Why can't you do this? function getDataAsStream() {
var stream2 = ...;
return stream2;
}
// Same ... used in your example above to construct the stream
var stream = getDataAsStream() ...; Edit: Re-ordered sentences for clarity. |
You're right -- should be able to do that. Was just thinking about it as:
But it makes just as much sense as
|
OK. Since we have #240 now, and we seem to have consensus, I'll go ahead and close this as unnecessary. |
Discussions on 3.0.0 have mentioned #166 a few times, so here it is on the 3.0.0 branch.