0.0.3 • Published 7 years ago
smart-cq v0.0.3
concurrent-queue
A priority queue with configurable retry and concurrency
Table of Contents
Install
npm:
npm install smart-cqyarn:
yarn add smart-cqUsage
const CQueue = require('smart-cq');
const cqueue = new CQueue({
concurrency: 10,
retries: 3
});
const asyncTask = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 1000);
});
}
cqueue.enqueue(asyncTask)Options
concurrency- (default:Infinity) - concurrent tasks to runretries- (default:3) - retry attempts on failed tasks
Contributors
| Name | Website |
|---|---|
| Shaun Warman | https://shaunwarman.com |