Closed bnoordhuis closed 10 years ago
Thanks @bnoordhuis . The ref/unref stuff on interval is node specific? How is it different from clearInterval?
Cheers, Felix. Yes, it's node-specific; clearInterval() disables a timer while unref() lets the timer keep running but won't prevent the process from exiting when everything else is finished. Basically:
setTimeout(f, 1000); // this scripts keeps node alive for the next second
setTimeout(f, 1000).unref(); // but this script will exit right away
@bnoordhuis makes sense. do you need a new release for this on npm?
That would be great, thanks.
Cheers, Felix.
Add ref/unref methods so a meter doesn't keep the event loop alive when everything else has quit.
I tried to add a test but I have no idea how to check that with the test framework that you use.