0.3.1 • Published 9 years ago

redis-pubsub v0.3.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

redis-pubsub provides a simple interface to a single pub/sub channel on a Redis server. Build Status

var pubsub = require('redis-pubsub');

// Subscribe to channel 'foobar' on a local server.
var channel = pubsub.createChannel(6379, 'localhost', 'foobar');
channel.on('connect', function() {
    channel.on('message', function(msg) {
        console.log(msg.greeting);
        channel.end();
    });
    channel.send({ greeting: 'Hello world!' });
});

Other events are error and close.

Messages are serialized to JSON by default, so you can send regular objects across the wire. If this is undesirable, set the raw property:

var channel = pubsub.createChannel(...);
channel.raw = true;
0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

12 years ago