Skip to content

Instantly share code, notes, and snippets.

@rosstuck
Created May 26, 2012 08:58
Show Gist options
  • Save rosstuck/2793002 to your computer and use it in GitHub Desktop.
Save rosstuck/2793002 to your computer and use it in GitHub Desktop.
Redis pub/sub
var redis = require("redis");
var client = redis.createClient();
client.on("message", function (channel, message) {
console.log(channel + ": " + message);
});
client.subscribe("broadcast");
<?php
$client = new \Predis\Client()
$client->publish('broadcast', 'batman');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment