You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The redis cluster support caching the redis hash-slot in client for performance, and can dynamic add redis server nodes in running.
106
104
105
+
### another way to use acl redis easily
106
+
The acl::redis class inherits from all the other acl redis command class, which includes all the redis client commands. So you can use the acl::redis class just as you can do in all the redis-client-commands class.
int conn_timeout = 10, rw_timeout = 10, max_conns = 100;
147
+
148
+
// declare redis cluster ojbect
149
+
acl::redis_cluster cluster;
150
+
cluster.set(redis_addr, max_conns);
151
+
152
+
// redis operation command
153
+
acl::redis cmd;
154
+
155
+
// bind redis command with redis cluster
156
+
cmd.set_cluster(&cluster, max_conns);
157
+
158
+
const char* key = "test_key";
159
+
160
+
// call redis server
161
+
test_redis_string(cmd, key);
162
+
test_redis_key(cmd, key);
163
+
}
164
+
```
107
165
### add acl redis to your projects
166
+
Before you use the acl redis, you should compile the three base libraries which redis depending on. Enter the lib_acl, lib_protocol, lib_acl_cpp, and build the lib_acl.a, lib_protocol.a and lib_acl_cpp.a.
108
167
#### On UNIX/LINUX
109
168
In your Makefile, you should add below compiling flags:
110
169
-DLINUX2 for LINUX, -DFREEBSD for FreeBSD, -DMACOSX for MAXOS, -DSUNOS5 for Solaris X86;
0 commit comments