terlan98 / PubSubHW

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

INFT 3507 – Assignment 2 (Publish/Subscribe)

This python program uses the ZeroMQ library for implementing the publisher/subscriber messaging model.

⚡️ How can I run it?

  1. Open 2 terminals
  2. Run python3 Publisher.py in the first terminal
  3. Provide a folder path for the Publisher.

Note: Some OSs, like MacOS, may not allow access to specific folders (like Desktop) by default. If an error occurs due to this reason, please try another folder or change your OS settings to allow access. Alternatively, you can try running the program with 'sudo'

Publisher will periodically (every 10 seconds, by default) publish the contents of the given folder.

  1. Run python3 Subscriber.py in the second terminal
  2. The subscriber will print the messages that it receives.

🔧 Configuration

You can set the IP addresses, port, and publisher sleep time in Constants.py

⚠️ Warning

  • You should use Python 3
  • You should have ZeroMQ installed on your system

About


Languages

Language:Python 100.0%