A promisified bucket priority queue written in Typescript with no external dependencies.
node >= 5.0
npm i -S promise-priority-queue
import PromiseQueue from 'promise-priority-queue';
const concurrency = 10;
const queue = new PromiseQueue({ concurrency /** optional */ });
const priority = 1;
const task = async (): number => {
// do work
return 1;
};
const result: number = await queue.addTask( priority, task ); // resolves with the task result
Deep link to the PromiseQueue class