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

doc: clarify unshift EOF #29950

Closed
wants to merge 2 commits into from
Closed

Conversation

@ronag
Copy link
Contributor

ronag commented Oct 13, 2019

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
@Fishrock123

This comment has been minimized.

Copy link
Member

Fishrock123 commented Oct 15, 2019

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

@ronag

This comment has been minimized.

Copy link
Contributor Author

ronag commented Oct 15, 2019

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

@Fishrock123

This comment has been minimized.

Copy link
Member

Fishrock123 commented Oct 15, 2019

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

@ronag

This comment has been minimized.

Copy link
Contributor Author

ronag commented Oct 15, 2019

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

This comment has been minimized.

Copy link
Member

jasnell commented Oct 15, 2019

I think there would at least be value in documenting

@Fishrock123 Fishrock123 requested review from mcollina and removed request for mcollina Oct 16, 2019
@Fishrock123

This comment has been minimized.

Copy link
Member

Fishrock123 commented Oct 16, 2019

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

This comment has been minimized.

Copy link
Member

Trott commented Oct 16, 2019

@mcollina

This comment has been minimized.

Copy link
Member

mcollina commented Oct 16, 2019

Why we should not unshift EOF?

@ronag

This comment has been minimized.

Copy link
Contributor Author

ronag commented Oct 16, 2019

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.

Copy link
Member

mcollina left a comment

I do not see a compelling reason to change this.

@ronag

This comment has been minimized.

Copy link
Contributor Author

ronag commented Oct 16, 2019

I changed this to only a doc update. @Fishrock123

@ronag ronag force-pushed the nxtedition:stream-fix-unshift-eof branch from 20a6c34 to 4f73edf Oct 16, 2019
@mcollina mcollina removed the semver-major label Oct 16, 2019
Copy link
Member

mcollina left a comment

LGTM

doc/api/stream.md Outdated Show resolved Hide resolved
@ronag ronag changed the title stream: no unshift eof doc: clarify unshift EOF Oct 16, 2019
@ronag ronag force-pushed the nxtedition:stream-fix-unshift-eof branch from 7d15e65 to e184520 Oct 16, 2019
@Trott

This comment has been minimized.

@Trott Trott added the author ready label Oct 16, 2019
@Fishrock123 Fishrock123 added doc and removed errors labels Oct 16, 2019
@Trott

This comment has been minimized.

Copy link
Member

Trott commented Oct 16, 2019

Landed in 273d38b

Trott added 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>
@Trott Trott closed this Oct 16, 2019
MylesBorins added 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>
MylesBorins added 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>
@MylesBorins MylesBorins mentioned this pull request Oct 23, 2019
targos added 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 added 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.