Uh oh!
There was an error while loading. Please reload this page.
stream: add the pipeline destoryDestOnError option - #34133
Conversation
ronag
commented
Jun 30, 2020
Could we add a new signature to pipeline with something along the lines of: pipeline(arrayOfStreams,options,callback) |
rickyes
commented
Jun 30, 2020
Yes, I also found the missing documentation for this section, maybe we can create a new PR to document this separately. |
ronag
commented
Jun 30, 2020
I think in readable.pipe the option is called end to not end(). Maybe we should have { end, destroy } as options? |
rickyes
commented
Jul 1, 2020
It may be a little different, the |
mcollina
left a comment
There was a problem hiding this comment.
Can you add a test with more than 2 streams?
rickyes
commented
Jul 1, 2020
done |
I don't find this very elegant. Though I guess there is nothing wrong with it per se... though couldn't you easily achieve the same thing with: constdst=streams.pop()awaitfinished(pipeline(streams,()=>{}).on('error',(err)=>{// ...}).pipe(dst)) |
rickyes
commented
Jul 1, 2020
Come to think of it, maybe the way @ronag offers it would have fewer side effects. The PR implementation, when an error occurs during the transmission of a stream (response stream has been data sent) we send |
rickyes
commented
Jul 1, 2020
However, the disadvantage is that we need to combine two api together, which is not very convenient. |
ronag
commented
Jul 1, 2020
This is a bit of an edge case though... So I'm not sure how important the convenience is :). I'm not opposed to this PR, but I'm unsure whether we need it. |
198779e to
75ad480Comparerickyes
commented
Jul 8, 2020
ping @mcollina |
mcollina
commented
Jul 8, 2020
I would really like some feedbacks from @mafintosh |
| * `destroyDestOnError` {boolean} If value is false, the destination | ||
| is not destroyed when a stream error occurs. | ||
| **Default:** `true`. |
There was a problem hiding this comment.
| *`destroyDestOnError` {boolean} If value is false, the destination | |
| is not destroyed when a stream error occurs. | |
| **Default:**`true`. | |
| *`destroyDestOnError` {boolean} If value is `false`, the destination | |
| is not destroyed when a stream error occurs. **Default:** `true`. |
Not particularly in love with name destroyDestOnError but also don't have any better suggestions.
rickyes
commented
Jul 11, 2020
ping again @mafintosh |
mafintosh
commented
Jul 11, 2020
I don’t really see the use-case, since you’d have to do some error detection as well to make sure that the dest stream hasn’t been partially written, as the error could be lots of things from the pipeline. For the use case described in the issue I’d wait for the open event instead that @ronag recently standardized. In general, PR looks fine, -0 on the feature. |
rickyes
commented
Jul 11, 2020
Yes, that's what I was worried about at first, and I don't have a good way to handle the situation yet, so if people have some suggestions then Would be great. |
rickyes
commented
Aug 3, 2020
Due to lack of sufficient impetus, I will close this PR. |
Fixes: #26311
/cc @mcollina@ronag
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes