GitXplorerGitXplorer
m

stream-to-redis

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
17fb95c49801cf97d469753a2b6f4848e85abc25

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago
Unverified
4ffeb7f58a11c358d2b5fddde279b18e1a247cd6

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago
Unverified
e613fdabb4255de67d2297b0ba8ce65eedb3befc

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago
Unverified
04b07696c0960afaf981176fbba531264db3004d

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago
Unverified
892c57a76b4d563255d3cda1f6dce83b322b0a4d

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago
Unverified
760109676123d0b16d0cb4bc2c1fd41047067924

a real readable stream ! cool !

mmaboiteaspam committed 9 years ago

README

The README file for this repository.

stream to redis

two transforms to write/pull from redis.

It s not data streaming to redis key.

It s transforms to read and write into redis as a queue.

Install

npm i maboiteaspam/stream-to-redis --save

Usage

var through2  = require('through2');
var debug     = require('debug')('stream-to-redis');
var redis     = require('steam-to-redis');

var s1 = through2.obj();
s1.resume();
s1.pipe(redis.write('tomate'));

var s2 = redis.read('tomate');
s2.pipe(process.stdout)

for (var i=0;i<1000;i++){
  s1.write("message "+i+"\n")
}

s2.on('end', function () {
  debug('end of read')
  s1.end();
  //s2.end(); // you may call .end() on a redis-readable to
  // close the connection and end the stream.
  // if you have not passed infinity: true opt to the stream,
  // it will close soon.
  // Infinity should provide a mechanism to sub.
})

process.on('SIGINT', function() {
  s1.end();
  s2.end(); // close the underlying redis connection
})

read more