redis / hiredis

Minimalistic C client for Redis >= 1.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redisKeepAlive() add time parameters,User-defined cycle time

wb2712 opened this issue · comments

commented

/* Enable connection KeepAlive. */
int redisEnableKeepAlive(redisContext *c) {
if (redisKeepAlive(c, REDIS_KEEPALIVE_INTERVAL) != REDIS_OK)
return REDIS_ERR;
return REDIS_OK;
}
---> int redisEnableKeepAlive(redisContext *c, int interval)

In this way, the client can regularly and automatically check whether the server is normal and switch the connection object in time

commented

when subscribe.consume()
This can check whether the server connection is normal

I'm not sure I follow but are you asking for a public-facing API where you can set the keepalive interval?

commented

I'm not sure I follow but are you asking for a public-facing API where you can set the keepalive interval?

yes

commented

我不确定我是不是跟随,但您是否要请求一个面向公众的API,您可以在其中设置keepalive间隔吗?

Do you plan to add this interface because I use redis-plus-plus and rely on your interface to set the heartbeat time