This package has been deprecated

Author message:

Deprecated, not maintained

redis-tail

2.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i redis-tail

Weekly Downloads

0

Version

2.0.1

License

ISC

Last publish

Collaborators

  • dab00