Skip to content

C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform

License

Notifications You must be signed in to change notification settings

cpp-redis/cpp_redis

This branch is 62 commits ahead of, 1 commit behind Cylix/cpp_redis:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

201d96c · Oct 15, 2022
Oct 15, 2022
Jan 22, 2019
Nov 28, 2018
Sep 2, 2022
Oct 15, 2022
Nov 28, 2018
Jan 27, 2020
Nov 28, 2018
Nov 3, 2017
Oct 15, 2022
Oct 15, 2022
Oct 15, 2022
Oct 15, 2022
Oct 21, 2017
Aug 30, 2018
Oct 13, 2016
Sep 25, 2017
Nov 24, 2018
Oct 15, 2022
Oct 15, 2022
Sep 2, 2022
Aug 30, 2018
Feb 1, 2018
Oct 15, 2022
Mar 1, 2019
Nov 24, 2018
Jan 20, 2017
Jan 27, 2020
Sep 17, 2018
Mar 24, 2019
Jan 15, 2017
May 20, 2020
Oct 15, 2022

Repository files navigation

cpp_redis Build Status Build status

cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations, pipelining, sentinels and high availability.

Requirement

cpp_redis has no dependency. Its only requirement is C++11.

It comes with no network module, so you are free to configure your own, or to use the default one (tacopie)

Example

cpp_redis::client

cpp_redis::client client;

client.connect();

client.set("hello", "42");
client.get("hello", [](cpp_redis::reply& reply) {
  std::cout << reply << std::endl;
});
//! also support std::future
//! std::future<cpp_redis::reply> get_reply = client.get("hello");

client.sync_commit();
//! or client.commit(); for asynchronous call

cpp_redis::client full documentation and detailed example. More about cpp_redis::reply.

cpp_redis::subscriber

cpp_redis::subscriber sub;

sub.connect();

sub.subscribe("some_chan", [](const std::string& chan, const std::string& msg) {
  std::cout << "MESSAGE " << chan << ": " << msg << std::endl;
});
sub.psubscribe("*", [](const std::string& chan, const std::string& msg) {
  std::cout << "PMESSAGE " << chan << ": " << msg << std::endl;
});

sub.commit();

cpp_redis::subscriber full documentation and detailed example.

Wiki

A Wiki is available and provides full documentation for the library as well as installation explanations.

Doxygen

A Doxygen documentation is available and provides full API documentation for the library.

License

cpp_redis is under MIT License.

Contributing

Please refer to CONTRIBUTING.md.

Special Thanks

Mike Moening for his unexpected and incredible great work aiming to port cpp_redis on Windows, provides sentinel support and high availability support!

Author

Simon Ninon

About

C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 76.1%
  • HTML 6.2%
  • TeX 5.5%
  • CSS 4.9%
  • JavaScript 4.8%
  • CMake 1.3%
  • Other 1.2%