Python zeromq -- Multiple Publishers To a Single Subscriber?

Viewed 15308

I'd like to write a python script (call it parent) that does the following:

(1) defines a multi-dimensional numpy array

(2) forks 10 different python scripts (call them children). Each of them must be able to read the contents of the numpy array from (1) at any single point in time (as long as they are alive).

(3) each of the child scripts will do it's own work (children DO NOT share any info with each other)

(4) at any point in time, the parent script must be able to accept messages from all of its children. These messages will be parsed by the parent and cause the numpy array from (1) to change.


How do I go about this, when working in python in a Linux environment? I thought of using zeroMQ and have the parent be a single subscriber while the children will all be publishers; does it make sense or is there a better way for this?

Also, how do I allow all the children to continuously read the contents of the numpy array that was defined by the parent ?

3 Answers
Related