@@ -19,9 +19,34 @@ class redis_request;
19
19
class ACL_CPP_API redis_command
20
20
{
21
21
public:
22
+ /* *
23
+ * 缺省的构造函数,如果使用此构造函数初始化类对象,则必须调用 set_client 或
24
+ * set_cluster 设置 redis 客户端命令类对象的通讯方式。
25
+ * default constructor. You must set the communication method by
26
+ * set_client or set_cluster functions.
27
+ */
22
28
redis_command ();
29
+
30
+ /* *
31
+ * 当使用非集群模式时的构造函数,可以使用此构造函数设置 redis 通信类对象。
32
+ * Using this constructor to set the redis communication mode,
33
+ * usually in no-cluster mode.
34
+ * @param conn {redis_client*} redis 通信类对象
35
+ * the redis communication in no-cluster mode
36
+ */
23
37
redis_command (redis_client* conn);
38
+
39
+ /* *
40
+ * 使用集群模式的构造函数,在构造类对象时指定了集群模式的 redis_cluster 对象。
41
+ * Using this constructor to set the redis_cluster, usually in
42
+ * cluster mode.
43
+ * @param cluster {redis_cluster*} redis 集群连接对象
44
+ * redis cluster object in cluster mode
45
+ * @param max_conns {size_t} 与集群中所有结点之间的每个连接池的最大连接数
46
+ * the max of every connection pool with all the redis nodes
47
+ */
24
48
redis_command (redis_cluster* cluster, size_t max_conns);
49
+
25
50
virtual ~redis_command () = 0 ;
26
51
27
52
/* *
@@ -39,9 +64,9 @@ class ACL_CPP_API redis_command
39
64
void reset (bool save_slot = false );
40
65
41
66
/* *
42
- * 在使用连接池方式时 ,通过本函数将从连接池获得的连接对象;
43
- * when using connection pool and not in cluster mode, the function
44
- * is used to set the connection for next redis command operation.
67
+ * 在使用非集群方式时 ,通过本函数将从连接池获得的连接对象;
68
+ * when not using cluster mode, the function is used
69
+ * to set the connection for next redis command operation.
45
70
* @param conn {redis_client*} 与 redis 客户端命令进行关联;
46
71
* the redis connection to be set in next redis operation
47
72
*/
@@ -232,6 +257,7 @@ class ACL_CPP_API redis_command
232
257
const redis_result** scan_keys (const char * cmd, const char * key,
233
258
int & cursor, size_t & size, const char * pattern,
234
259
const size_t * count);
260
+
235
261
/* ******************************************************************/
236
262
237
263
void build (const char * cmd, const char * key,
0 commit comments