#include <pgsql_manager.hpp>
|
| pgsql_manager (time_t idle_ttl=120) |
|
| ~pgsql_manager () |
|
pgsql_manager & | add (const pgsql_conf &conf) |
|
| connect_manager (void) |
|
virtual | ~connect_manager (void) |
|
void | bind_thread (bool yes) |
|
void | init (const char *default_addr, const char *addr_list, size_t count, int conn_timeout=30, int rw_timeout=30) |
|
void | set (const char *addr, size_t count, int conn_timeout=30, int rw_timeout=30) |
|
const conn_config * | get_config (const char *addr, bool use_first=false) |
|
void | set_retry_inter (int n) |
|
void | set_idle_ttl (time_t ttl) |
|
void | set_check_inter (int n) |
|
void | remove (const char *addr) |
|
connect_pool * | get (const char *addr, bool exclusive=true, bool restore=false) |
|
virtual connect_pool * | peek (void) |
|
virtual connect_pool * | peek (const char *key, bool exclusive=true) |
|
void | lock (void) |
|
void | unlock (void) |
|
std::vector< connect_pool * > & | get_pools (void) |
|
size_t | check_idle (size_t step, size_t *left=NULL) |
|
size_t | size (void) const |
|
connect_pool * | get_default_pool (void) |
|
void | statistics (void) |
|
bool | start_monitor (connect_monitor *monitor) |
|
connect_monitor * | stop_monitor (bool graceful=true) |
|
void | set_pools_status (const char *addr, bool alive) |
|
|
connect_pool * | create_pool (const char *addr, size_t count, size_t idx) |
|
void | set_service_list (const char *addr_list, int count, int conn_timeout, int rw_timeout) |
|
conns_pools & | get_pools_by_id (unsigned long id) |
|
connect_pool * | create_pool (const conn_config &cf, size_t idx) |
|
void | create_pools_for (pools_t &pools) |
|
void | remove (pools_t &pools, const char *addr) |
|
void | set_status (pools_t &pools, const char *addr, bool alive) |
|
unsigned long | get_id (void) const |
|
void | get_key (const char *addr, string &key) |
|
void | get_addr (const char *key, string &addr) |
|
connect_pool * | add_pool (const char *addr) |
|
| noncopyable () |
|
| ~noncopyable () |
|
◆ pgsql_manager()
acl::pgsql_manager::pgsql_manager |
( |
time_t |
idle_ttl = 120 | ) |
|
◆ ~pgsql_manager()
acl::pgsql_manager::~pgsql_manager |
( |
| ) |
|
◆ add()
◆ create_pool()
connect_pool* acl::pgsql_manager::create_pool |
( |
const char * |
addr, |
|
|
size_t |
count, |
|
|
size_t |
idx |
|
) |
| |
|
protectedvirtual |
基类 connect_manager 虚函数的实现
- 参数
-
addr | {const char*} 服务器监听地址,格式:ip:port |
count | {size_t} 连接池的大小限制,该值为 0 时则没有限制 |
idx | {size_t} 该连接池对象在集合中的下标位置(从 0 开始) |
- 返回
- {connect_pool*} 返回创建的连接池对象
实现了 acl::connect_manager.
该类的文档由以下文件生成: