From 2534f740aa6160016cdf8145e50ce6496a34d769 Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Tue, 22 Feb 2011 21:59:57 -1000 Subject: [PATCH] Update pub_sub example to show where to put auth. --- examples/pub_sub.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/pub_sub.js b/examples/pub_sub.js index d64cc428d8..595cae6e91 100644 --- a/examples/pub_sub.js +++ b/examples/pub_sub.js @@ -31,4 +31,12 @@ client1.on("message", function (channel, message) { }); client1.incr("did a thing"); -client1.subscribe("a nice channel", "another one"); + +client1.on("ready", function () { + // if you need auth, do it here + client1.subscribe("a nice channel", "another one"); +}); + +client2.on("ready", function () { + // if you need auth, do it here +});