ycmjason / asyncLimit

Limit the number of concurrent asynchronous calls to a function.

Home Page:https://www.npmjs.com/package/@ycm.jason/async-limit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@ycm.jason/asyncLimit

Limits the concurrent calls to a function.

Install

npm i --save @ycm.jason/async-limit

Usage

const readFile = require('util').promisify(require('fs').readFile);
const asyncLimit = requrie('@ycm.jason/async-limit');

const limitedReadFile = asyncLimit(readFile, 10);

// limitedReadFile can only have 10 concurrent calls at the same time

Author

Jason Yu

About

Limit the number of concurrent asynchronous calls to a function.

https://www.npmjs.com/package/@ycm.jason/async-limit


Languages

Language:JavaScript 100.0%