Created
July 11, 2012 05:35
-
-
Save tblobaum/3088191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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