Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Apr 6, 2020

Slightly cleans up the destroyer logic. Make readable and writable use similar logic.

i.e.

    if (!err && reading && !writing && stream.writable) {
      return callback();
    }

    if (!err && !reading && writing && stream.readable) {
      return callback();
    }
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Slightly cleans up the destroyer logic.
@ronag ronag added the stream Issues and PRs related to the stream subsystem. label Apr 6, 2020
@nodejs-github-bot
Copy link
Collaborator

if (err || !final || !stream.readable) {
destroyImpl.destroyer(stream, err);
if (!err && !reading && writing && stream.readable) {
return callback();
}
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I follow?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 13, 2020

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 20, 2020
@@ -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) {
Copy link
Member

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();
  }
}

Copy link
Member Author

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?

@ronag ronag added blocked PRs that are blocked by other issues or PRs. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 21, 2020
@ronag
Copy link
Member Author

ronag commented Apr 21, 2020

This might be redundant given #32966

@ronag
Copy link
Member Author

ronag commented Apr 21, 2020

closed in favor of #32968

@ronag ronag closed this Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked PRs that are blocked by other issues or PRs. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants