rediscallback失败后不会触发
示例代码,我正在使用:
var conf = require('../Config'), redisConf = conf.get('redis'), redis = require('redis'), redisClient = redis.createClient(redisConf.port, redisConf.host), redisSub = redis.createClient(redisConf.port, redisConf.host); redisSub.subscribe('test'); redisSub.on('message', function(channel, data) { console.log('got message on channel: ' + channel + ' with message: ' + data); redisClient.get .... }); redisSub.on('error', function (err) { console.log("redisSub error: " + err); }); redisSub.on('ready', function () { console.log('redisSub subscriber ready'); }); redisSub.on('reconnecting', function () { console.log('redisSub subscriber reconnecting'); }); redisSub.on('end', function () { console.log('redisSub subscriber ended'); }); redisClient.on('error', function (err) { console.log("redisClient error: " + err); }); redisClient.on('ready', function () { console.log('redisClient ready'); }); redisClient.on('reconnecting', function () { console.log('redisClient reconnecting'); }); redisClient.on('end', function () { console.log('redisClient ended'); });
我启动nodejs服务器,一切都按预期工作。 当我重新启动redis服务器时,没有任何callback被调用,并且我没有得到任何消息在通道上,并且在我重新启动nodejs服务器之后,redis客户端连接正常,并且一切再次运行。
- ibm的watson-developer-cloud Node.js sdk的发现模块中的updateDocument api坚持一个文件参数
- fs.appendFile,但如果path不存在,则失败
- Node.js中的中间件devise模式:连接
- Sails / Bookshelf运行使用Sails / Bookshelf环境的脚本
- Node + Express与静态HTML。 如何将所有请求路由到index.html?
- 导致Node.JS + Express故障的CSRF中间件
- nodejs http post请求抛出TypeError
- MongoDB:如何将一个模式用作不同文件中定义的不同集合的子文档
- 带有碎片的Android Socket.IO