simple-pouch

0.2.0 • Public • Published

simple-pouch

version download

js-standard-style

A simple, lightweight queue using Redis rpush and lrange, ltrim.

Usage

var pouch = require('../lib/pouch').create({
  host: '127.0.0.1',
  port: 6379,
  name: 'test',
  size: 50
})
 
// put items
pouch.put(['1', '2', '3', '4', '5'])
pouch.put(function (err, len) {
  console.log(len)
}, ['6', '7', '8', '9', '10'])
 
pouch.count(function (err, count) {
  console.log('count: ' + count)
})
 
setTimeout(function () {
  pouch.list(function (err, items) {
    console.log('list', items)
  }, 0, 100)
 
  pouch.pick(function (err, items) {
    console.log(items)
 
    pouch.count(function (err, count) {
      console.log('count: ' + count)
    })
  }, 8)
}, 500)
 

Release History

See the changelog

LICENSE

simple-pouch is licensed under the MIT license.

Package Sidebar

Install

npm i simple-pouch

Weekly Downloads

2

Version

0.2.0

License

MIT

Last publish

Collaborators

  • egg-