Oraq
Description
Oraq (Ordered redis asynchronous queue) is a cross process, cross server, fast, reliable and lightweight redis-based async queue for Node.
Features
- super fast
- cross process
- easy to use
Compatibility
Supports node.js >= 7.6.0.
Installation
npm install --save oraq
Usage
const Oraq = ;const oraq = id: 'myQueue' concurrency: 1; const job = ; // do a lot of heavy jobs with concurrency 1Promiseall 14000 8000 10000 7000 ;
Constructor options
const oraq = id // id {string} (limiters with the same prefix and id share their queues, "queue" by default) prefix // custom redis key prefix {string} ("oraq" by default) connection // redis connection param {any} (anything that ioredis constructor supports) ping // processing job keep alive interval in ms {integer} (60000 by default) timeout // job will run after this time {integer} (in case of too long previous tasks processing, 2 * 60 * 60 * 1000 (2 hours) by default) concurrency // jobs concurrency {integer} (1 by default) mode // mode {string} ("limiter" - rate limiter (no order guarantee) or "queue" - real queue (keep order), "queue" by default);
API
const oraq = ; oraq; oraq // same as ioredis quit method (used to close redis connection) ; oraq // remove job from pending queue ;
Tests
npm test
License
MIT © Yevhen Samoilenko