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

timers: allow passing delay to timer.refresh() #40434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Oct 12, 2021

No description provided.

@mscdex mscdex added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Oct 12, 2021
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 12, 2021
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@targos
Copy link
Member

targos commented Oct 13, 2021

@nodejs/timers

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Oct 20, 2021

@mscdex ... can I ask you to provide a short change description and rationale?

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

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

I'd like to know why/for what this is useful before this is merged?

Like - I know there is probably a reasonable use case for this but I don't know what it is

@mscdex
Copy link
Contributor Author

mscdex commented Apr 26, 2022

@benjamingr In my particular case I have a queue of waiting tasks, each with varying start timestamps. With the changes in this PR I can reuse a single timer object for the entire queue and simply do something like timer.refresh(Date.now() - nextTask.startTime).

@mscdex mscdex force-pushed the timers-refresh-args branch 2 times, most recently from a4510d4 to efff092 Compare April 26, 2022 19:46
@benjamingr benjamingr dismissed their stale review April 26, 2022 23:14

meh, ok I guess

@nodejs-github-bot
Copy link
Collaborator

@targos targos added the semver-minor PRs that contain new features and should be released in the next minor version. label Apr 27, 2022
@nodejs-github-bot
Copy link
Collaborator

@mscdex
Copy link
Contributor Author

mscdex commented Apr 27, 2022

@jasnell I'm not sure what you're asking for. Were you just interested in hearing a use case like @benjamingr ?

@aduh95
Copy link
Contributor

aduh95 commented May 11, 2024

This needs a rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version. 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.

7 participants