2.0.1 • Published 7 years ago

redis-tail v2.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

redis-tail

Module to brpop or brpoplpush Redis list using redis client for node

require("redis-tail")

Example

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);
  });

Tail factory

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

Tests

  • set REDIS_CONNECTION_STRING environment variable
  • run npm test
2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago