Skip to content

Instantly share code, notes, and snippets.

@mranney
Forked from sh1mmer/gist:592695
Created September 22, 2010 22:22
Show Gist options
  • Save mranney/592698 to your computer and use it in GitHub Desktop.
Save mranney/592698 to your computer and use it in GitHub Desktop.
var EE = require('events').EventEmitter,
sys = require('sys');
ee = new EE();
die = false;
ee.on('die', function() {
die = true;
});
while(!die) {
console.log("Setting timeout " + setTimeout(function() {
console.log("Emitting event.");
ee.emit('die');
}, 1));
}
console.log('done');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment