Module to brpop or brpoplpush Redis list using redis client for node
require("redis-tail")
const redis = require('redis');
const tail = require('redis-tail');
const client = redis.createClient();
client
.on('error', (err) => { throw err; })
.once('ready', () => {
tail(client, { pop: 'key:pop', push: 'key:push' })
.on('next', console.log)
.on('error', console.error);
});
require("redis-tail")(client, opts)
@param {Object} client - redis client
@param {Object} opts
@param {string} opts.pop - redis list key to pop items from
@param {string} [opts.push] - redis list key to push items to
@param {number} [opts.timeout = 0]
@param {number} [opts.errorTimeout = 1000]
@returns {tail}
@typedef {Object} tail - instance of EventEmitter
@fires error - on error
@fires next - on list next item
- set REDIS_CONNECTION_STRING environment variable
- run
npm test