Skip to content

Instantly share code, notes, and snippets.

@misterdjules
Created August 4, 2014 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterdjules/5ef3b7c5b0a7334a6e09 to your computer and use it in GitHub Desktop.
Save misterdjules/5ef3b7c5b0a7334a6e09 to your computer and use it in GitHub Desktop.
Repro for https://github.com/joyent/node/issues/8065 but with internal timers.
var timers = require('timers');
myInternalTimeout = function(callback, after) {
var timer = {};
timers.enroll(timer, after);
timers._unrefActive(timer);
timer._onTimeout = callback;
return timer;
};
function foo() { console.log('foo'); }
var myInternalTimer = myInternalTimeout(foo, 300.1);
setInterval(function() { timers._unrefActive(myInternalTimer); }, 350);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment