denodrivers/redis

[feat] keepalive feature

manyuanrong opened this issue · 0 comments

I have been working on trying to use Deno in the production environment to promote the ecological improvement and development of deno. Recently, I launched an application using redis in the production environment.

In practical applications, we usually prefer to share a redis connection for multiple requests. For this, we usually implement a singleton or a connection pool. To promote the use of this library in production, we need to improve the connection management and increase the keepalive function. , otherwise access again after a period of inactivity will send an error and affect the availability of the service.

It is simple and efficient to use a timer to periodically send a ping request to the server, which I think should be the default behavior of this library