Simple question: What’s the difference with child_process.fork between cluster.fork
detail:
-
can I pass arguments to cluster.fork
-
can I listen on same port or unixsock for ChildProcess create by child_process.fork
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Read the docs:
child_process.forkvscluster.fork.http://nodejs.org/api/cluster.html
Not according to the docs, and:
(a function’s
lengthis its number of formal parameters). Use message passing instead.Presumably yes, since
cluster.forkis implemented on top ofchild_process.fork. However, there is a reason thatcluster.forkalready exists, if you want to listen on the same port.