-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
stream: cleanup pipeline destroyer #32690
Conversation
Slightly cleans up the destroyer logic.
if (err || !final || !stream.readable) { | ||
destroyImpl.destroyer(stream, err); | ||
if (!err && !reading && writing && stream.readable) { | ||
return callback(); | ||
} |
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.
Maybe merge writable and readable.
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.
not sure I follow?
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.
lgtm
@@ -54,9 +54,11 @@ function destroyer(stream, reading, writing, final, callback) { | |||
return callback(); | |||
} | |||
|
|||
if (err || !final || !stream.readable) { | |||
destroyImpl.destroyer(stream, err); | |||
if (!err && !reading && writing && stream.readable) { |
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.
if (!err) {
if (reading) {
if (!writing && stream.writable) {
return callback();
}
} else if (writing && stream.readable) {
return callback();
}
}
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.
I suppose this is a nit?
This might be redundant given #32966 |
closed in favor of #32968 |
Slightly cleans up the destroyer logic. Make readable and writable use similar logic.
i.e.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes