Skip to content

Should timers return a thenable by default? #19426

@benjamingr

Description

@benjamingr

We can already util.promisify(setTimeout), but technically we can make timer objects contain a .then method (getter?) that could create a promise only when awaited allowing timers to be await without having to call util.promisify or sacrificing performance of timers for regular users.

  • Do we like this?
  • Do we think it's a good idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    promisesIssues and PRs related to ECMAScript promises.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions