acl
3.5.3.0
|
#include <redis_client_pool.hpp>
Public 成员函数 | |
redis_client_pool (const char *addr, size_t count, size_t idx=0) | |
virtual | ~redis_client_pool (void) |
redis_client_pool & | set_ssl_conf (sslbase_conf *ssl_conf) |
redis_client_pool & | set_password (const char *pass) |
redis_client_pool & | set_db (int dbnum) |
int | get_db (void) const |
Public 成员函数 继承自 acl::connect_pool | |
connect_pool (const char *addr, size_t max, size_t idx=0) | |
virtual | ~connect_pool () |
connect_pool & | set_timeout (int conn_timeout, int rw_timeout) |
connect_pool & | set_retry_inter (int retry_inter) |
connect_pool & | set_idle_ttl (time_t ttl) |
connect_pool & | set_check_inter (int n) |
connect_client * | peek (bool on=true) |
void | bind_one (connect_client *conn) |
void | put (connect_client *conn, bool keep=true) |
int | check_idle (time_t ttl, bool exclusive=true) |
void | set_alive (bool ok) |
bool | aliving () |
const char * | get_addr () const |
size_t | get_max () const |
size_t | get_count () const |
size_t | get_idx () const |
void | reset_statistics (int inter) |
unsigned long long | get_total_used () const |
unsigned long long | get_current_used () const |
void | set_key (const char *key) |
const char * | get_key (void) const |
Protected 成员函数 | |
connect_client * | create_connect (void) |
Protected 成员函数 继承自 acl::connect_pool | |
void | set_delay_destroy () |
Protected 成员函数 继承自 acl::acl::noncopyable | |
noncopyable () | |
~noncopyable () | |
额外继承的成员函数 | |
Protected 属性 继承自 acl::connect_pool | |
bool | alive_ |
bool | delay_destroy_ |
int | retry_inter_ |
time_t | last_dead_ |
char | key_ [256] |
char | addr_ [256] |
int | conn_timeout_ |
int | rw_timeout_ |
size_t | idx_ |
size_t | max_ |
size_t | count_ |
time_t | idle_ttl_ |
time_t | last_check_ |
int | check_inter_ |
locker | lock_ |
unsigned long long | total_used_ |
unsigned long long | current_used_ |
time_t | last_ |
std::list< connect_client * > | pool_ |
redis 连接池类,该类继承于 connect_pool,在 connect_pool 定义了通用的有关 TCP 连接池的通用方法。 redis connection pool inherting from connect_pool, which includes TCP connection pool methods.
在文件 redis_client_pool.hpp 第 18 行定义.
acl::redis_client_pool::redis_client_pool | ( | const char * | addr, |
size_t | count, | ||
size_t | idx = 0 |
||
) |
构造函数 constructor
addr | {const char*} 服务端地址,格式:ip:port the redis-server's listening address, format: ip:port |
count | {size_t} 连接池的最大连接数限制,如果此值为 0,则连接池 没有上限限制。 the max connections for each connection pool. there is no connections limit of the pool when the count is 0. |
idx | {size_t} 该连接池对象在集合中的下标位置(从 0 开始) the subscript of the connection pool in the connection cluster |
|
virtual |
|
protectedvirtual |
基类纯虚函数: 调用此函数用来创建一个新的连接 virtual function in class connect_pool to create a new connection
实现了 acl::connect_pool.
|
inline |
redis_client_pool& acl::redis_client_pool::set_db | ( | int | dbnum | ) |
在非集群模式下,本方法用来设置连接建立后所选择的db in no-cluster mode, the method is used to select the db after the connection is created
dbnum | {int} |
redis_client_pool& acl::redis_client_pool::set_password | ( | const char * | pass | ) |
redis_client_pool& acl::redis_client_pool::set_ssl_conf | ( | sslbase_conf * | ssl_conf | ) |
设置 SSL 通信方式下的配置句柄,内部缺省值为 NULL,如果设置了 SSL 连 接配置对象,则内部切换成 SSL 通信方式 set SSL communication with Redis-server if ssl_conf not NULL
ssl_conf | {sslbase_conf*} |