File: chat-websocket/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   chat-websocket/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js   Download  
File: chat-websocket/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 507 bytes
 

Contents

Class file image Download
var client = require("redis").createClient(), client2 = require("redis").createClient(); client.subscribe("something"); client.on("subscribe", function (channel, count) { console.log("Got sub: " + channel); client.unsubscribe("something"); }); client.on("unsubscribe", function (channel, count) { console.log("Got unsub: " + channel + ", quitting"); client.quit(); }); // exercise unsub before sub client2.unsubscribe("something"); client2.subscribe("another thing"); client2.quit();