rozu-queue

1.0.4 • Public • Published

rozu-queue

Offline processing queue for rozu webhook server.

build status

Example

var queue = require('rozu-queue')('rozu', 6379, 'localhost');
 
function repeat () {
    process.nextTick(function () {
        queue.process(50).then(function (data) {
            // do something with `data`
            repeat();
        }, function (e) {
            console.error(e.stack);
            repeat();
        });
    });
}
 
repeat();

API

constructor(channel, port, host)

Takes the redis channel, port & host as parameters, and creates an in RAM queue which can be batched processed with delays, as well as an easy drain.

process(n = 1, delay = 0)

Returns a Promise of the data to be processed.

drain(fn)

Drains the queue and executes an optional Function against the items if provided.

License

Copyright (c) 2015 Jason Mulligan All Rights Reserved

Package Sidebar

Install

npm i rozu-queue

Weekly Downloads

1

Version

1.0.4

License

BSD-3-Clause

Last publish

Collaborators

  • avoidwork