Skip to content

using Timer._called #1539

Closed
Closed

Description

@ORESoftware

How stable/safe is it to reference _called on a timer for library code?

const to = setTimeout(() => {
  console.log(to._called);
}, 10);

console.log(to._called);

before it times out, it is false, after it times out, it is true.
Is this a stable API, can we use it?

Activity

  1. ORESoftware commented on Oct 15, 2018

    @ORESoftware
    Author

    bamp

  2. addaleax commented on Oct 17, 2018

    @addaleax
    Member

    I guess this wouldn’t be removed without a semver-major change, but you can’t be sure of that. It’s not stable API, and it’s not even public API – if you need something like this, you could propose something like timer.called as a public API that forwards this.

  3. ORESoftware commented on Oct 18, 2018

    @ORESoftware
    Author

    @addaleax yes that makes sense, since you have Le Clout do you want to propose on the Node Github issues? O/w I can do it

  4. gireeshpunathil commented on Jun 11, 2019

    @gireeshpunathil
    Member

    @ORESoftware - looking at the code, nodejs/node#20555 seems to have removed this field. And given the main intent of that PR is to improve timer performance, I guess an RFE for the above API may require a justification in terms of use case, inability to meet some programming scenarios etc.

  5. gireeshpunathil commented on Jun 26, 2019

    @gireeshpunathil
    Member

    no action identified, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions