1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Small style changes

This commit is contained in:
Ruben Bridgewater
2015-10-04 21:44:52 +02:00
parent 2fc54ece57
commit 7922d4eb85
28 changed files with 386 additions and 390 deletions

View File

@@ -1,33 +1,33 @@
'use strict';
var redis = require("redis"),
var redis = require('redis'),
client1 = redis.createClient(),
client2 = redis.createClient(),
client3 = redis.createClient(),
client4 = redis.createClient(),
msg_count = 0;
client1.on("psubscribe", function (pattern, count) {
console.log("client1 psubscribed to " + pattern + ", " + count + " total subscriptions");
client2.publish("channeltwo", "Me!");
client3.publish("channelthree", "Me too!");
client4.publish("channelfour", "And me too!");
client1.on('psubscribe', function (pattern, count) {
console.log('client1 psubscribed to ' + pattern + ', ' + count + ' total subscriptions');
client2.publish('channeltwo', 'Me!');
client3.publish('channelthree', 'Me too!');
client4.publish('channelfour', 'And me too!');
});
client1.on("punsubscribe", function (pattern, count) {
console.log("client1 punsubscribed from " + pattern + ", " + count + " total subscriptions");
client1.on('punsubscribe', function (pattern, count) {
console.log('client1 punsubscribed from ' + pattern + ', ' + count + ' total subscriptions');
client4.end();
client3.end();
client2.end();
client1.end();
});
client1.on("pmessage", function (pattern, channel, message) {
console.log("("+ pattern +")" + " client1 received message on " + channel + ": " + message);
client1.on('pmessage', function (pattern, channel, message) {
console.log('('+ pattern +')' + ' client1 received message on ' + channel + ': ' + message);
msg_count += 1;
if (msg_count === 3) {
client1.punsubscribe();
}
});
client1.psubscribe("channel*");
client1.psubscribe('channel*');