From eb6e9273aa31e637338adbd052427bbdbc47a18b Mon Sep 17 00:00:00 2001 From: brianc Date: Tue, 12 Apr 2011 14:11:08 -0700 Subject: [PATCH] Updated Client (markdown) --- Client.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Client.md b/Client.md index 0814ba0..4400787 100644 --- a/Client.md +++ b/Client.md @@ -311,12 +311,15 @@ Used for "LISTEN/NOTIFY" interactions. You can do some fun pub-sub style stuff client1.on('notification', function(msg) { console.log(msg.channel); //outputs 'boom' }); - client1.query("LISTEN boom", function() { + client1.query("LISTEN boom"); + //need to let the first query actually complete + //client1 will remain listening to channel 'boom' until it's 'end' is called + setTimeout(function() { client2.query("NOTIFY boom", function() { client1.end(); client2.end(); }); - }); + }, 1000); ```