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: support dispose in writable #48547

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

benjamingr
Copy link
Member

Add support to Symbol.asyncDispose in writable streams. Additionally add a test for writable, transform and duplex streams (that inherit from readable/writable) to avoid breakage.

cc @nodejs/streams @MoLow @atlowChemi

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 25, 2023
Add support to Symbol.asyncDispose in writable streams.
Additionally add a test for writable, transform and duplex streams
who inherit from readable/writable to avoid breakage.
@benjamingr benjamingr added stream Issues and PRs related to the stream subsystem. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 25, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 25, 2023
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@atlowChemi atlowChemi left a comment

Choose a reason for hiding this comment

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

LGTM

@benjamingr benjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 25, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 25, 2023
@nodejs-github-bot

This comment was marked as outdated.

Co-authored-by: Robert Nagy <ronagy@icloud.com>
@benjamingr benjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 25, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 25, 2023
@nodejs-github-bot
Copy link
Collaborator

});
let count = 0;
duplex.on('error', common.mustCall((e) => {
assert.strictEqual(count++, 0); // Ensure not called twice
Copy link
Member

Choose a reason for hiding this comment

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

common.mustCall accepts a count argument: common.mustCall(fn, times)

@nodejs-github-bot
Copy link
Collaborator

Co-authored-by: Robert Nagy <ronagy@icloud.com>
@benjamingr benjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 29, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 29, 2023
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented May 11, 2024

This needs a rebase.

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

error = this.writableFinished ? null : new AbortError();
this.destroy(error);
}
return new Promise((resolve, reject) => eos(this, (err) => (err && err.name !== 'AbortError ? reject(err) : resolve(null))));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return new Promise((resolve, reject) => eos(this, (err) => (err && err.name !== 'AbortError ? reject(err) : resolve(null))));
return new Promise((resolve, reject) => eos(this, (err) => (err && err.name !== 'AbortError' ? reject(err) : resolve(null))));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants