Skip to content
forked from Cylix/cpp_redis

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

License

Notifications You must be signed in to change notification settings

JiekeZhu/cpp_redis

 
 

Repository files navigation

cpp_redis Build Status

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

Requirement

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

Example

cpp_redis::redis_client:

cpp_redis::redis_client client;

client.connect();

client.set("hello", "42");
client.get("hello", [](cpp_redis::reply& reply) {
  std::cout << reply << std::endl;
});

client.commit();
# or client.sync_commit(); for synchronous call

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

cpp_redis::redis_subscriber:

cpp_redis::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();
# or sub.sync_commit(); for synchronous call

cpp_redis::redis_subscriber full documentation and detailed example.

Wiki

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

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!
  • Tobias Gustafsson for contributing and reporting issues
  • Alexis Vasseur for reporting me issues and spending time helping me debugging
  • Pawel Lopko for reporting me issues

Author

Simon Ninon

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 97.8%
  • CMake 1.9%
  • Shell 0.3%