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 [email protected]
Co-authored-by: Anatoli Papirovski [email protected]

Refs: #21152

PR-URL: #34017
Reviewed-By: James M Snell [email protected]
Reviewed-By: Bradley Farias [email protected]
Reviewed-By: Jeremiah Senkpiel [email protected]
Reviewed-By: Anna Henningsen [email protected]
Reviewed-By: Trivikram Kamat [email protected]
Reviewed-By: Yongsheng Zhang [email protected]
Reviewed-By: Benjamin Gruenbaum [email protected]
Signed-off-by: Denys Otrishko [email protected]

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 <[email protected]>
Co-authored-by: Anatoli Papirovski <[email protected]>

Refs: nodejs#21152

PR-URL: nodejs#34017
Backport-PR-URL: nodejs#34482
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Signed-off-by: Denys Otrishko <[email protected]>
@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 <[email protected]>
Co-authored-by: Anatoli Papirovski <[email protected]>

Refs: #21152

Backport-PR-URL: #34482
PR-URL: #34017
Backport-PR-URL: #34482
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Signed-off-by: Denys Otrishko <[email protected]>
@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 <[email protected]>
Co-authored-by: Anatoli Papirovski <[email protected]>

Refs: #21152

Backport-PR-URL: #34482
PR-URL: #34017
Backport-PR-URL: #34482
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Signed-off-by: Denys Otrishko <[email protected]>
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