smart-cq

0.0.3 • Public • Published

concurrent-queue

build status code coverage code style styled with prettier made with lass license npm downloads

A priority queue with configurable retry and concurrency

Table of Contents

Install

npm:

npm install smart-cq

yarn:

yarn add smart-cq

Usage

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 run
  • retries - (default: 3) - retry attempts on failed tasks

Contributors

Name Website
Shaun Warman https://shaunwarman.com

License

MIT © Shaun Warman

Package Sidebar

Install

npm i smart-cq

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

8.1 kB

Total Files

9

Last publish

Collaborators

  • shaunwarman