Giter Club home page Giter Club logo

boost_redis_clients's Introduction

Boost Redis Queue Implementation

This repository contains C++ code for implementing a Redis queue, comprising a queue pusher, a queue consumer, and tests.

Installation Guide:

  1. Prerequisites:

    • C++ compiler with C++11 support
    • Boost C++ Libraries
    • Redis server (for running the queue consumer and tests)
  2. Setting up Boost C++ Libraries:

    • Download and install Boost C++ Libraries from boost.org.
    • Make sure Boost is properly configured and available in your build environment.
  3. Setting up Redis Server:

    • Install and configure Redis server on your machine. You can follow instructions from the official Redis website.
  4. Building the Code:

    • Clone this repository to your local machine.
    • Navigate to the root directory of the repository.
    • Compile the code using a C++ compiler, linking against Boost Libraries. For example:
      g++ -o queue-pusher queue-pusher.cpp -I /usr/include/boost/ -lpthread -lcrypto -lssl
      g++ -o queue-consumer queue-consumer.cpp -I /usr/include/boost/ -lpthread -lcrypto -lssl
      g++ -o redis-test redis-test.cpp  -I /usr/include/boost/ -lgtest -lgtest_main -lgmock -lpthread
      

Usage Guide:

  1. Queue Pusher:

    • Compile queue-pusher.cpp using the provided installation guide.
    • Run the compiled executable. It will prompt you to enter data to push to the Redis queue. Press Ctrl+D to finish input.
    • The data entered will be pushed onto the Redis queue named my_queue.
  2. Queue Consumer:

    • Compile queue-consumer.cpp using the provided installation guide.
    • Run the compiled executable with the following command line arguments:
      ./queue-consumer [HOST] [PORT] [Name of Queue] [optional: Number of Elements to Pop]
      
      Replace [HOST], [PORT], and [Name of Queue] with the appropriate values. Optionally, specify the number of elements to pop from the queue.
    • The consumer will connect to the Redis server, pop the specified number of elements from the queue, and print them.
  3. Running Tests:

    • Compile redis-test.cpp using the provided installation guide.
    • Run the compiled test executable. It will execute test cases for the Producer class.
    • The tests verify that the Producer correctly sends data to the Redis queue.

Note:

  • Make sure Redis server is running before executing the queue consumer and tests.
  • Adjust Redis server configurations and connection settings as per your environment.

boost_redis_clients's People

Contributors

neelaksh-singh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.