Is it possible to run a function as a completely separate node.js process? For example:
var parallel = require("parallel");
parallel(function(){
var app = require("express")();
app.on("/",function(req,res){ res.send("hi"); });
app.listen(80);
},function callback(err,stdout){
console.log("process terminated!")
});
Is something like that possible?
First off, try to use the idiomatic way of load-balancing. For node, this is asynchronous design. See these other answers for more info:
There are options though:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With