Skip to content

doc: clarify unshift EOF - #29950

Closed
ronag wants to merge 2 commits into
nodejs:masterfrom
nxtedition:stream-fix-unshift-eof
Closed

doc: clarify unshift EOF#29950
ronag wants to merge 2 commits into
nodejs:masterfrom
nxtedition:stream-fix-unshift-eof

Conversation

@ronag

Copy link
Copy Markdown
Member

We should not allow unshifting EOF.

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

@nodejs-github-botnodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. stream Issues and PRs related to the stream subsystem. labels Oct 13, 2019
@Fishrock123

Copy link
Copy Markdown
Contributor

@ronag Could you please describe what the present behavior is? (i.e. before this change.)

@ronag

Copy link
Copy Markdown
MemberAuthor

@Fishrock123: Previously unshift(null) would be the same as push(null).

@Fishrock123

Copy link
Copy Markdown
Contributor

As in, end the stream? It seems reasonable then to also accept unshift to end the stream in an ‘expedited’ way?

@ronag

Copy link
Copy Markdown
MemberAuthor

As in, end the stream? It seems reasonable then to also accept unshift to end the stream in an ‘expedited’ way?

Well, it's not really 'expedited' since it is exactly the same as push(null).

Unshifting "eof" sounds very weird to me. Though, now that you question it there is probably no harm in it either... I don't mind closing this.

@jasnell

Copy link
Copy Markdown
Member

I think there would at least be value in documenting

@Fishrock123
Fishrock123 requested review from mcollina and removed request for mcollinaOctober 16, 2019 01:27
@Fishrock123

Copy link
Copy Markdown
Contributor

I think we should document it, and then think about if you should be able to actually unshift EOF so that it comes before other data.

@Trott

Copy link
Copy Markdown
Member

@nodejs/streams

@mcollina

Copy link
Copy Markdown
Member

Why we should not unshift EOF?

@mcollinamcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 16, 2019
@ronag

ronag commented Oct 16, 2019

Copy link
Copy Markdown
MemberAuthor

Why we should not unshift EOF?

I guess the confusion is, what does it mean to unshift EOF? Right now it behaves exactly like push EOF which is unexpected/confusing/undefined.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not see a compelling reason to change this.

@ronag

ronag commented Oct 16, 2019

Copy link
Copy Markdown
MemberAuthor

I changed this to only a doc update. @Fishrock123

@ronag
ronagforce-pushed the stream-fix-unshift-eof branch from 20a6c34 to 4f73edfCompareOctober 16, 2019 10:55
@mcollinamcollina removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 16, 2019

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment threaddoc/api/stream.md Outdated
@ronagronag changed the title stream: no unshift eofdoc: clarify unshift EOFOct 16, 2019
@ronag
ronagforce-pushed the stream-fix-unshift-eof branch from 7d15e65 to e184520CompareOctober 16, 2019 18:52
@Trott

Copy link
Copy Markdown
Member

@TrottTrott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 16, 2019
@Fishrock123Fishrock123 added doc Issues and PRs related to the documentations. and removed errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Oct 16, 2019
@Trott

Copy link
Copy Markdown
Member

Landed in 273d38b

Trott pushed a commit that referenced this pull request Oct 16, 2019
PR-URL: #29950
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@TrottTrott closed this Oct 16, 2019
MylesBorins pushed a commit that referenced this pull request Oct 23, 2019
PR-URL: #29950
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@MylesBorinsMylesBorins mentioned this pull request Oct 23, 2019
targos pushed a commit that referenced this pull request Nov 8, 2019
PR-URL: #29950
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
targos pushed a commit that referenced this pull request Nov 10, 2019
PR-URL: #29950
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@targostargos mentioned this pull request Nov 10, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.docIssues and PRs related to the documentations.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@ronag@Fishrock123@jasnell@Trott@mcollina@richardlau@nodejs-github-bot