Socket.io with Redis -
what difference between socket.io-redis , socket.io-emitter? need both?
on documentation, says first need create redis adapter:
var io = require('socket.io')(3000); var redis = require('socket.io-redis'); io.adapter(redis({ host: 'localhost', port: 6379 })); followed immidiately saying can emit messages with:
var io = require('socket.io-emitter')({ host: '127.0.0.1', port: 6379 }); setinterval(function(){ io.emit('time', new date); }, 5000); there example of socket.io-redis connecting redis , emitting events itself, dont understand why both packages, socket.io-redis , socket.io-emitter, used together: https://github.com/h4t0n/socket.io-redis-appsample/blob/master/app.js
Comments
Post a Comment