This python program uses the ZeroMQ library for implementing the publisher/subscriber messaging model.
- Open 2 terminals
- Run
python3 Publisher.py
in the first terminal - 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.
- Run
python3 Subscriber.py
in the second terminal - The subscriber will print the messages that it receives.
You can set the IP addresses, port, and publisher sleep time in Constants.py
- You should use Python 3
- You should have ZeroMQ installed on your system