Skip to content

Instantly share code, notes, and snippets.

@reu
Created April 9, 2013 01:51
Show Gist options
  • Select an option

  • Save reu/5342276 to your computer and use it in GitHub Desktop.

Select an option

Save reu/5342276 to your computer and use it in GitHub Desktop.

Revisions

  1. reu created this gist Apr 9, 2013.
    12 changes: 12 additions & 0 deletions pub-sub.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    var redis = require("redis")
    , subscriber = redis.createClient()
    , publisher = redis.createClient();

    subscriber.on("message", function(channel, message) {
    console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
    });

    subscriber.subscribe("test");

    publisher.publish("test", "haaaaai");
    publisher.publish("test", "kthxbai");