Created
July 22, 2016 15:58
-
-
Save EugeneKostrikov/1f1e138386a587446af2c0d465e8972e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on('message', function(msg){ | |
require(msg.path)(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(){ | |
var count = 0; | |
while (true){ | |
if (count++ % 1000000000 === 0){ | |
console.log('while true'); | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(){ | |
setInterval(function(){ | |
console.log('running fine'); | |
}, 1000); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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