Skip to content

Instantly share code, notes, and snippets.

@tblobaum
Created July 11, 2012 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tblobaum/3088191 to your computer and use it in GitHub Desktop.
Save tblobaum/3088191 to your computer and use it in GitHub Desktop.
//
// example
var Redis = require('redis-stream')
, redis = new Redis(6379, 'localhost')
//
// reimplementation of rpoplpush with streams
var rpoplpush = redis.stream('rpop')
rpoplpush.pipe(redis.stream('lpush', 'list-two'))
rpoplpush.write('list-one')
rpoplpush.end()
//
// get all members in `myset` and lpush them to `myset-two`
var smemberslpush = redis.stream('smembers')
smemberslpush.pipe(redis.stream('lpush', 'myset-two'))
smemberslpush.write('myset')
smemberslpush.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment