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

[v14.x backport] timers: allow timers to be used as primitives #34482

Closed

Conversation

lundibundi
Copy link
Member

This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: Bradley Farias bradley.meck@gmail.com
Co-authored-by: Anatoli Papirovski apapirovski@mac.com

Refs: #21152

PR-URL: #34017
Reviewed-By: James M Snell jasnell@gmail.com
Reviewed-By: Bradley Farias bradley.meck@gmail.com
Reviewed-By: Jeremiah Senkpiel fishrock123@rocketmail.com
Reviewed-By: Anna Henningsen anna@addaleax.net
Reviewed-By: Trivikram Kamat trivikr.dev@gmail.com
Reviewed-By: Yongsheng Zhang zyszys98@gmail.com
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Signed-off-by: Denys Otrishko shishugi@gmail.com

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

/cc @MylesBorins

@lundibundi lundibundi added timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. v14.x labels Jul 22, 2020
This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: Bradley Farias <bradley.meck@gmail.com>
Co-authored-by: Anatoli Papirovski <apapirovski@mac.com>

Refs: nodejs#21152

PR-URL: nodejs#34017
Backport-PR-URL: nodejs#34482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Signed-off-by: Denys Otrishko <shishugi@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@lundibundi
Copy link
Member Author

@MylesBorins was this accidentally missed from the latest v14 release or is there something else to be done here?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax mentioned this pull request Aug 10, 2020
@codebytere codebytere force-pushed the v14.x-staging branch 2 times, most recently from 92340c9 to b30b518 Compare August 11, 2020 16:39
MylesBorins pushed a commit that referenced this pull request Aug 17, 2020
This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: Bradley Farias <bradley.meck@gmail.com>
Co-authored-by: Anatoli Papirovski <apapirovski@mac.com>

Refs: #21152

Backport-PR-URL: #34482
PR-URL: #34017
Backport-PR-URL: #34482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Signed-off-by: Denys Otrishko <shishugi@gmail.com>
@MylesBorins
Copy link
Contributor

landed in cca0372

addaleax pushed a commit that referenced this pull request Sep 22, 2020
This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: Bradley Farias <bradley.meck@gmail.com>
Co-authored-by: Anatoli Papirovski <apapirovski@mac.com>

Refs: #21152

Backport-PR-URL: #34482
PR-URL: #34017
Backport-PR-URL: #34482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Signed-off-by: Denys Otrishko <shishugi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants