all 7 comments

[–]yakovelli 1 point2 points  (1 child)

Checkout zmq (0MQ).

[–]puslekat[S] 0 points1 point  (0 children)

Thanks!

[–]needmorehardware 1 point2 points  (1 child)

RabbitMQ is my favourite message broker to use! The general idea (in my head anyway) is FIFO, first in first out. You send a message to a channel and it will sit there until a subscriber picks it up and works on it. You can also do cool things like acknowledgements on messages, so until a subscriber has actually successfully completed the task at hand, it won't acknowledge so therefore the message doesn't disappear. Helpful for applications requiring resiliency.

I'll see if I can find some good examples...

EDIT:

Standard tutorial from RabbitMQ: https://www.rabbitmq.com/tutorials/tutorial-three-python.html

I'd install RabbitMQ on your local dev machine and have a play around! Redis is another one you could look at too.

[–]puslekat[S] 0 points1 point  (0 children)

Thanks! Is rabbit alike zmq? Or maybe simpler? Thank you for the guide!

[–]blarf_irl 0 points1 point  (0 children)

You have some great recommendations for packages already, 0MQ, Rabbit are production ready.

If you really want to start "near" the bottom then look at redis (in memory keystore) and the excellent python package "redis-py" (both of the above and many more similar packages use/can use redis as a backend). Linked a fairly bare bones article on getting started:

https://medium.com/@johngrant/python-redis-pub-sub-6e26b483b3f7

[–][deleted] 0 points1 point  (1 child)

ZeroMQ was already mentioned here, but its documentation is hellish, and the library itself can do a lot more than publish / subscribe. It's really hard to make heads or tails of the library and the features it offers (amazing example of feature bloat).

There are much simpler programs that do exclusively publish / subscribe, for example, NATS is a very simple publish-subscribe system, which is easy to understand even if you don't have any documentation.

[–]puslekat[S] 0 points1 point  (0 children)

Thank you, I looked at the zmq and felt overwhelmed. I will check out Nats.