When doing worker = cluster.fork() I would like to be able to forward the stdout and stderr streams into the master Node.js process.
How can I do that?
I tried doing:
worker = cluster.fork();
worker.process.stdout.pipe(process.stdout)
// ^ this is null
A workaround would be to use messages, but I want to be able to stream content.
worker.on("message", function(msg){
console.log("Master says:" + msg);
});
...
worker.send({message:'hello'});
How can I access the stdout of the forked process/cluster?
Stackoverflow Question
When doing
worker = cluster.fork()I would like to be able to forward the stdout and stderr streams into the master Node.js process.How can I do that?
I tried doing:
A workaround would be to use messages, but I want to be able to stream content.
How can I access the stdout of the forked process/cluster?
Stackoverflow Question