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

Documentation writable stream example confusing order #30759

Closed
GrosSacASac opened this issue Dec 2, 2019 · 4 comments
Closed

Documentation writable stream example confusing order #30759

GrosSacASac opened this issue Dec 2, 2019 · 4 comments
Labels
doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.

Comments

@GrosSacASac
Copy link
Contributor

writer.on('finish', () => {
  console.log('All writes are now complete.');
});

should be before

writer.end('This is the end\n');

https://nodejs.org/api/stream.html#stream_event_finish

@devsnek devsnek added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Dec 3, 2019
@dev-script
Copy link
Contributor

@GrosSacASac i would like to work on this issue.

@dev-script
Copy link
Contributor

Hello @GrosSacASac , i want to ask one query.

The 'finish' event is emitted after the stream.end() method has been called, and all data has been flushed to the underlying system. so here i have to change 'after the stream.end()' line also.

@GrosSacASac
Copy link
Contributor Author

I am not sure what you mean exactly ?

You can always make a PR it does not need to be perfect, you can always do follow up commits if something needs to be changed.

@dev-script
Copy link
Contributor

I am not sure what you mean exactly ?

You can always make a PR it does not need to be perfect, you can always do follow up commits if something needs to be changed.

ok

@Trott Trott closed this as completed in 08728a1 Dec 13, 2019
MylesBorins pushed a commit that referenced this issue Dec 17, 2019
doc change for stream.md that 'finish' event should be before
writer.end

fixes: #30759

PR-URL: #30889
Fixes: #30759
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this issue Jan 14, 2020
doc change for stream.md that 'finish' event should be before
writer.end

fixes: #30759

PR-URL: #30889
Fixes: #30759
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BethGriggs pushed a commit that referenced this issue Feb 6, 2020
doc change for stream.md that 'finish' event should be before
writer.end

fixes: #30759

PR-URL: #30889
Fixes: #30759
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants