The redis module in Acl is a powerful redis client library with higth performance, rich interface and easy to use. There are more than 13 C++ classes and over 150 commands in Acl redis, including STRING, HASH, LIST, SET, ZSET, HyperLogLog, PUBSUB, STREAM, TRANSACTION, SCRIPT, CONNECTION, SERVER, etc. User using Acl redis doesn't need care about network comminucation, redis protocol, hash slots caching, etc., just like using C++ STL standard interface.
<hr>
* [0. Introduction](#0-introduction)
* [1. Building Acl redis](#1-building-acl-redis)
* [1.1. Compiling on UNIX/LINUX](#11-compiling-on-unixlinux)
* [1.2. Compiling on Windows](#12-compiling-on-windows)
* [2. Write some examples using Acl redis](#2-write-some-examples-using-acl-redis)
* [2.1. Simple example for redis STRING and redis KEY](#21-simple-example-for-redis-string-and-redis-key)
* [2.2. Redis client cluster example for redis3.0+](#22-redis-client-cluster-example-for-redis30)
* [2.3. Using redis client cluster in multi-threads](#23-using-redis-client-cluster-in-multi-threads)
* [2.4. Use redis pipeline in multi-threads](#24-use-redis-pipeline-in-multi-threads)
* [3. Add Acl redis to your projects](#3-add-acl-redis-to-your-projects)
* [3.1. On UNIX/LINUX](#31-on-unixlinux)
* [3.2. On Windows](#32-on-windows)
* [4. Reference](#4-reference)
* [5. About Acl](#5-about-acl)
<hr>
## 1. Building Acl redis
Acl redis is a part of lib_acl_cpp, so users only need to build the Acl project.
### 1.1. Compiling on UNIX/LINUX
- Enter the root directory of the Acl project and type **make**, **libacl_all.a** will be created later, which consists of three libraries: **libacl_cpp.a**, **lib_protocol.a** and **lib_acl.a**;
- Compile redis samples: Enter into lib_acl_cpp/samples/redis and type **make**, all the redis samples(including redis_cluster, redis_connection, redis_hash, redis_hyperloglog, redis_key, redis_lib, redis_manager, redis_pool, redis_pubsub, redis_server, redis_set, redis_string, redis_trans, redis_zset, redis_zset_pool, redis_client_cluster) will be compiled.
### 1.2. Compiling on Windows
Users can use `VS2003/VS2008/VS2010/VS2012/VS2015/VS2017/VS1019` to compile all Acl libraries by opening the Acl projects(acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln, acl_cpp_vc2015.sln, acl_cpp_vc2017.sln, acl_cpp_vc2019.sln) with the corresponding VS tools. Due to the dependency in Acl, lib_acl should be compiled first, then lib_protocol, and finally lib_acl_cpp.
## 2. Write some examples using Acl redis
### 2.1. Simple example for redis STRING and redis KEY:
The redis cluster module of Acl supports caching the redis hash slots on client to improve performance, and can dynamically change local hash slots at runtime.
Before using Acl redis, you should compile the three basic libraries. Enter the *lib_acl*, *lib_protocol*, *lib_acl_cpp*, and build the `lib_acl.a`, `lib_protocol.a` and `libacl_cpp.a`.
Open the VS projects, such as acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln, acl_cpp_vc2013.sln, acl_cpp_vc2015.sln, acl_cpp_vc2017.sln, or acl_cpp_vc2019.sln to look at the redis samples project option setting.