A priority queue with configurable retry and concurrency
MIT License
A priority queue with configurable retry and concurrency
npm:
npm install smart-cq
yarn:
yarn add smart-cq
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)
concurrency
- (default: Infinity
) - concurrent tasks to runretries
- (default: 3
) - retry attempts on failed tasksName | Website |
---|---|
Shaun Warman | https://shaunwarman.com |