mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 08:50:53 +08:00
38 lines
886 B
C++
38 lines
886 B
C++
|
#pragma once
|
|||
|
#include "acl_cpp/acl_cpp_define.hpp"
|
|||
|
#include "acl_cpp/connpool/connect_pool.hpp"
|
|||
|
|
|||
|
namespace acl
|
|||
|
{
|
|||
|
|
|||
|
class ACL_CPP_API redis_pool : public connect_pool
|
|||
|
{
|
|||
|
public:
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>캯<EFBFBD><EFBFBD>
|
|||
|
* @param addr {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ip:port
|
|||
|
* @param count {int} <EFBFBD><EFBFBD><EFBFBD>ӳص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param idx {size_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳض<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>±<EFBFBD>λ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD>ʼ)
|
|||
|
*/
|
|||
|
redis_pool(const char* addr, int count, size_t idx = 0);
|
|||
|
virtual ~redis_pool();
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD>估<EFBFBD><EFBFBD><EFBFBD><EFBFBD> IO <EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>)
|
|||
|
* @param conn_timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
* @param rw_timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> IO <EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>)
|
|||
|
* @return {redis_pool&}
|
|||
|
*/
|
|||
|
redis_pool& set_timeout(int conn_timeout = 30, int rw_timeout = 60);
|
|||
|
|
|||
|
protected:
|
|||
|
// <20><><EFBFBD>ി<EFBFBD>麯<EFBFBD><E9BAAF>
|
|||
|
virtual connect_client* create_connect();
|
|||
|
|
|||
|
private:
|
|||
|
int conn_timeout_;
|
|||
|
int rw_timeout_;
|
|||
|
};
|
|||
|
|
|||
|
} // namespace acl
|