Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

rp-queue

1.1.0 • Public • Published

Install

$ npm install --save rp-queue

Usage

const RPQueue = require('rp-queue');
 
let tasks = [
    function(){
        return Promise.resolve()
    },
    function(){
        return Promise.resolve()
    },
    function(){
        return Promise.resolve()
    },
    function(){
        return Promise.resolve()
    },
    function(){
        return Promise.resolve()
    }
];
 
RPQueue(tasks, 2).then(()=>{
    console.log('done');
});
 
=======================
 
const RPQueue = require('rp-queue');
 
let tasks = [
    1,2,3,4,5
];
 
RPQueue(tasks, {
    limit: 2,
    process: tid => Promise.resolve(tid)
}).then(()=>{
    console.log('done');
});
 

Install

npm i rp-queue

DownloadsWeekly Downloads

5

Version

1.1.0

License

MIT

Unpacked Size

3.57 kB

Total Files

3

Last publish

Collaborators

  • avatar