0

I will have one python process A which will publish messages constantly, i.e. a "feed" if you will. I will have some other python processes B's which will subscribe the "feed" and receive consume messages. Any B can start/stop at any time. A typical B will subscribe after its start-up and expect to receive messages published after its subscription. B will not send any message to A --- A should start to pump messages to B's automatically up on their subscriptions. The many B's don't have to subscribe at the same time --- they can come and go as they need, A will have to serve them without knowing when they will come and go. Let's say the number of B's will be 1-10 for now (might be bigger later on if this model turn out working).

I wonder what python module provides the above functionality?

I have looked at multiprocess and zmq mentioned in this post. Apparently they are 1-to-1 connections. What I need (I think) is 1-to-many. Also in my case B's won't send messages to A and A constantly push messages to B's.

p.s. Python 3.x

Roy
  • 880
  • 1
  • 12
  • 27
  • ZeroMQ can do that. Check out http://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html – mkrieger1 Mar 11 '18 at 20:54
  • The publisher/subscriber model in `zmq` is exactly what I needed. Thank you @mkrieger1. – Roy Mar 12 '18 at 17:17

0 Answers0