I know how to use multiprocessing to start a separate process and make concurrent data processing.
What I like to know now, is, if I have several main processes (let's say several wsgi processes), how can I create only one separate process for all the main processes ?
Each main process should be able to communicate with the separate process using a queue, but each are started separatly, in a different Python VM.
E.G:
- process 1 -> start separate process -> talk to separate process
- process 2 -> notice the separate process is started and don't start another -> talk to separate process
- process 3 -> notice the separate process is started and don't start another -> talk to separate process
If one process notice the process has died, it can start it again.
Is that possible ? and how ?
If yes suppose it must involve using a PID file.