acl/lib_acl_cpp/include/acl_cpp/redis/redis_cluster.hpp

34 lines
807 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "acl_cpp/acl_cpp_define.hpp"
#include "acl_cpp/connpool/connect_manager.hpp"
namespace acl
{
class ACL_CPP_API redis_cluster : public connect_manager
{
public:
/**
* 构造函数
* @param conn_timeout {int} 服务器连接超时时间(秒)
* @param rw_timeout {int} 网络 IO 读写超时时间(秒)
*/
redis_cluster(int conn_timeout, int rw_timeout);
virtual ~redis_cluster();
protected:
/**
* 基类纯虚函数,用来创建连接池对象
* @param addr {const char*} 服务器监听地址格式ip:port
* @param count {int} 连接池的大小限制
* @param idx {size_t} 该连接池对象在集合中的下标位置(从 0 开始)
*/
virtual acl::connect_pool* create_pool(const char* addr,
int count, size_t idx);
private:
int conn_timeout_;
int rw_timeout_;
};
} // namespace acl