Answer the question
In order to leave comments, you need to log in
How to "link" parallel processes in nodejs?
I'm using a library that uses another ( https://github.com/rvagg/node-worker-farm) library to run processes in parallel. These processes use the code I wrote, which needs to be "connected" somehow, to establish a connection between these parallel processes and the parent. How to do it? This is the first time I’ve come across something like this and I don’t even know where to start, so I’ll be glad for any specifics and code.
Answer the question
In order to leave comments, you need to log in
Look, here I see that this library returns an object of type ChildProcess .
So you can send a message to a child process and receive it.
If you need more complex logic, then you can use pipes or tcp connections. Or any other way of inter-process communication (google, nodejs IPC or nodejs inter-process communication).
I am using Redis. You can use Nsq. Everything depends on the tasks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question