Browse Source

redis

master
zeus 4 years ago
parent
commit
195e40cb0f
  1. 6
      swarmlab-app/src/run/app.js

6
swarmlab-app/src/run/app.js

@ -24,18 +24,24 @@ pubClient.on("connect", function() {
console.log("You are now connected"); console.log("You are now connected");
}); });
setInterval(function () {
var resob1 = {} var resob1 = {}
resob1.data = '1' resob1.data = '1'
resob1.user25user = 'user' resob1.user25user = 'user'
var resob1string = JSON.stringify(resob1); var resob1string = JSON.stringify(resob1);
console.log('-------------------- '+JSON.stringify(resob1string));
pubClient.hmset('ekjgpiegwerpowfmfsdfsdgsk', resob1string, function(err, res) { pubClient.hmset('ekjgpiegwerpowfmfsdfsdgsk', resob1string, function(err, res) {
console.log('>>>>>>>>>eroor>>>>>>>>>>>>>>>>>>> '+JSON.stringify(err));
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(res)); console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(res));
}); });
pubClient.hgetall('ekjgpiegwerpowfmfsdfsdgsk', function(err, object) { pubClient.hgetall('ekjgpiegwerpowfmfsdfsdgsk', function(err, object) {
console.log('<<<<<<<<<<eroor<<<<<<<<<<<<<<<<< '+JSON.stringify(err));
console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< '+JSON.stringify(object)); console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< '+JSON.stringify(object));
}); });
}, 3000);
http.listen(3000, () => console.error('listening on http://localhost:3000/')); http.listen(3000, () => console.error('listening on http://localhost:3000/'));
console.error('socket.io example'); console.error('socket.io example');

Loading…
Cancel
Save