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: Readable.off #29486

Closed
wants to merge 1 commit into from
Closed

stream: Readable.off #29486

wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Sep 7, 2019

We have special logic in removeListener() which must apply
to off() as well.

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-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Sep 7, 2019
We have special logic in removeListener() which must apply
to off() as well.
@devsnek
Copy link
Member

devsnek commented Sep 8, 2019

perhaps we should change ee.off to call this.removeListener instead of being an alias? this seems surprising for anyone extending ee.

@benjamingr
Copy link
Member

I would prefer @devsnek's suggestion but I am still LGTM.

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

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Sep 9, 2019

Alternative: #29503.

@benjamingr
Copy link
Member

@ronag I understood @devsnek's suggestion as making removeListener an alias to off for streams (and not general even emitters).

I think #29503 is a bit scary at its current form :]

@ronag
Copy link
Member Author

ronag commented Sep 9, 2019

@benjamingr I’m fine with either.

@ronag
Copy link
Member Author

ronag commented Sep 9, 2019

@ronag I understood @devsnek's suggestion as making removeListener an alias to off for streams (and not general even emitters).

I don't think that makes any more sense than this PR. Would make sense for EE to ensure this doesn't happen at all. However, as you point out it looks and is quite scary.

I think this PR is the most appropriate right now.

@devsnek
Copy link
Member

devsnek commented Sep 9, 2019

I was recommending what #29503 does, I see having to manually override this as a bug in EventEmitter's API.

@ronag
Copy link
Member Author

ronag commented Sep 9, 2019

@devsnek I agree. But, I think #29503 needs significant more thought.

@ronag
Copy link
Member Author

ronag commented Sep 9, 2019

I think this is semver-patch while #29503 is semver-major. I still think it makes sense to merge this first?

@mcollina
Copy link
Member

I think we should land this and backport it.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Sep 20, 2019

@Trott: This looks ready?

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 22, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Trott pushed a commit that referenced this pull request Sep 23, 2019
We have special logic in removeListener() which must apply
to off() as well.

PR-URL: #29486
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@Trott
Copy link
Member

Trott commented Sep 23, 2019

Landed in 1665a93

@Trott Trott closed this Sep 23, 2019
targos pushed a commit that referenced this pull request Sep 23, 2019
We have special logic in removeListener() which must apply
to off() as well.

PR-URL: #29486
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Sep 24, 2019
BridgeAR pushed a commit that referenced this pull request Sep 25, 2019
We have special logic in removeListener() which must apply
to off() as well.

PR-URL: #29486
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants