我正在编写一个基于nodejs 5.10.1的应用程序,并连接到redis服务器。
我使用来自https://github.com/luin/ioredis的ioredis nodejs模块。
我似乎无法弄清楚如何检查是否已经建立了与服务器的连接。
连接到redis服务器的代码非常简单:
我不是很理解它的含义或如何使用它。有任何想法吗?
我使用来自https://github.com/luin/ioredis的ioredis nodejs模块。
我似乎无法弄清楚如何检查是否已经建立了与服务器的连接。
连接到redis服务器的代码非常简单:
var Redis = require('ioredis');
var redis = new Redis();
文档在连接事件下说明如下:
You can also check out the Redis#status property to get the current connection status.
我不是很理解它的含义或如何使用它。有任何想法吗?