Skip to content

Instantly share code, notes, and snippets.

@sh1mmer
Created September 22, 2010 22:17
Show Gist options
  • Save sh1mmer/592695 to your computer and use it in GitHub Desktop.
Save sh1mmer/592695 to your computer and use it in GitHub Desktop.
EE = require('events').EventEmitter;
ee = new EE();
die = false;
ee.on('die', function() {
die = true;
});
while(!die) {
setTimeout(function() {
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