Hi,
I'm getting check errors when using .unref() on timers in Node.js. In practise I'm using .unref() to ensure the process can shutdown properly. Without it the process will not exit by itself cause the event loop isn't empty.
I'm more than happy to create a PR with the definition, but not sure what the best approach would be to avoid breaking the current definitions of clearInterval() and clearTimeout(). Making the Node.js setInterval() return a timer instance as described in the Node.js docs, would not work with the mentioned clear-methods expecting a number: https://github.com/facebook/flow/blob/master/lib/core.js#L766.
Any thoughts?
metrics.js
setInterval(reportProcessMetrics, 10 * 1000).unref();
output
metrics.js:58
58: setInterval(reportProcessMetrics, 10 * 1000).unref();
^^^^^ property `unref`. Property not found in
58: setInterval(reportProcessMetrics, 10 * 1000).unref();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Number
Refs Node.js Timers docs: https://nodejs.org/api/timers.html#timers_class_timeout
Hi,
I'm getting check errors when using
.unref()on timers in Node.js. In practise I'm using.unref()to ensure the process can shutdown properly. Without it the process will not exit by itself cause the event loop isn't empty.I'm more than happy to create a PR with the definition, but not sure what the best approach would be to avoid breaking the current definitions of
clearInterval()andclearTimeout(). Making the Node.jssetInterval()return a timer instance as described in the Node.js docs, would not work with the mentionedclear-methods expecting anumber: https://github.com/facebook/flow/blob/master/lib/core.js#L766.Any thoughts?
metrics.js
output
Refs Node.js Timers docs: https://nodejs.org/api/timers.html#timers_class_timeout