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
Pipe event conflict with readable-stream v3 / node.js core #14
Comments
Ah didn't know! Thats a bug. Will fix. |
Additional somewhat related comment + this.stream.once('data', noop)
+ pipeTo.emit('pipe', this.stream)
- this.stream.emit('pipe', pipeTo) Adding the listener for I cloned streamx and tested the above patch, it didn't cause any new failures. On node.js 12+ I received a failure from I can open a separate issue for adding a |
@coreyfarrell thanks for working on these things! @mafintosh heads up that streamx is going to be used inside gulp v5, which we are pushing on right now. 🎉 Thanks for all the great work! |
@coreyfarrell let's do another issue for the data listener, cause it triggers slow paths in streamx adding one, so let's see if we can't solve it @phated uhhhh! |
Something that I thought would be worth mentioning is that I've often wanted |
It is important that we be able to know the direction of the pipe, I think it would be problematic if |
What about:
Then we have compat and an event on both ends (someone better at naming than me chime in :D) |
@phated do you think a separate event specifically for 'piping out' is useful or is knowing something wants data from |
@coreyfarrell I'm not sure of the question exactly, but if you are asking which events the |
Btw, I think |
I just saw this from Matteo:
I think that the |
Yes this is why I asked. I don't know of a situation where you'd need to know "this is specifically being piped out", generally you need to know "something wants data from this stream". This is the case in |
A good case for "this is specifically being piped out" is to emit extra metadata when a stream is piped (e.g. when Browserify is piped, they could emit the filename to the upstream consumer) ^ The important part is that the emit would contain a reference to the stream so you could emit more data to it. |
Where'd we land on getting this changed? |
I’ll land this today :) |
Fixed and released in latest patch (bug fix). I've also documented |
I just did some testing and I think this issue is resolved. Thanks @mafintosh! |
readable-stream v3 and node.js core use
dest.emit('pipe', src)
while streamx usessrc.emit('pipe', dest)
.Demonstration script:
Run the script with and without an argument:
The text was updated successfully, but these errors were encountered: