give_connection
将通过take_connection获取的redis客户端连接对象返还到连接池中
声明
void give_connection(object c)
参数
参数名 | 描述 |
---|---|
c | redis客户端连接对象 |
返回值
无
使用方式
hiredis.setup_redis({
"thread_num" : 1,
});
map db_config = {
"driver" : "redis",
"host" : "localhost",
"port" : 6379,
"passwd" : "",
"db_index" : 1,
};
redis_pool.set_db_config("testdb", db_config);
object conn = redis_pool=>take_connection("testdb");
defer redis_pool=>give_connection(conn);
printf("conn=%M\n", conn);