0.2.0 • Published 11 years ago

subscribe-stream v0.2.0

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

subscribe-stream

A simple Readable object stream that consumes the data published to a specific redis pub/sub channel using node_redis.

note: We assume that it is a stringified json object coming through the pub/sub channel that is again parsed into an object because they are much nicer to deal with.

Example

var redis = require('redis'),
    subscribeStream = require('../');

var stream = subscribeStream({ subscription: 'hithere' });

var client = redis.createClient();

var testObj = {
  test: 'value',
  other: 'otherValue'
};

stream.on('readable', function () {
  var obj = stream.read();
  console.log('obj', obj);
});

client.publish('hithere', JSON.stringify(testObj));

Test

npm test

License

MIT

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago