Skip to content

The Configuration Pub-Sub concept is a simple server that listens for configuration updates and publishes them to a Redis server.

Notifications You must be signed in to change notification settings

lifelog-index/config-pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configuration Publishers - Subscribers

The Configuration Pub-Sub concept is a simple server that listens for configuration updates and publishes them to a Redis server. This allows other services using the same Redis server to receive the latest configuration updates seamlessly.

Install Redis

To install Redis, follow these steps:

  1. Download the latest version of Redis from here.

    wget https://download.redis.io/redis-stable.tar.gz
  2. Compile and install Redis:

    mkdir $HOME/redis/
    cp redis-stable.tar.gz $HOME/redis/
    cd $HOME/redis/
    tar xvzf redis-stable.tar.gz
    cd redis-stable
    make
  3. (Optional) Add Redis to the PATH:

    echo "alias redis-server='$HOME/redis/redis-stable/src/redis-server'" >> $HOME/.bashrc
    source $HOME/.bashrc

Start the Redis Server

To start the Redis server, run the following command:

redis-server

Usage

Requirements

pip install redis

Edit Configuration

Edit the config.cfg file according to your configuration requirements.

Publish Configuration

To publish the configuration, use the following command:

python publisher.py

Check Configuration Using a Python Subscriber

To check the configuration using a Python subscriber, follow these steps:

python subscriber.py
python publisher.py

About

The Configuration Pub-Sub concept is a simple server that listens for configuration updates and publishes them to a Redis server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages