Skip to content

Instantly share code, notes, and snippets.

@EugeneKostrikov
Created July 22, 2016 15:58
Show Gist options
  • Save EugeneKostrikov/1f1e138386a587446af2c0d465e8972e to your computer and use it in GitHub Desktop.
Save EugeneKostrikov/1f1e138386a587446af2c0d465e8972e to your computer and use it in GitHub Desktop.
process.on('message', function(msg){
require(msg.path)();
});
module.exports = function(){
var count = 0;
while (true){
if (count++ % 1000000000 === 0){
console.log('while true');
}
}
};
module.exports = function(){
setInterval(function(){
console.log('running fine');
}, 1000);
};
var async = require('async');
var cp = require('child_process');
async.parallel([
function(){
var c = cp.fork('./childRunner');
c.send({path: './funcA'});
},
function(){
var c = cp.fork('./childRunner');
c.send({path: './funcB'});
}
], function(){
console.log('doesnt have to reach there');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment