Skip to content

rrainn/AsyncFunctionBatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsyncFunctionBatch

This package lets you run a batch of async tasks in parallel, while limiting the number of concurrent tasks being run.

Installation

npm i --save asyncfunctionbatch

Usage

const {Job} = require("asyncfunctionbatch");

const array = ["hello", "world", "!"];
const concurrency = 10; // max number of tasks to run in parallel
const job = new Job(array, concurrency, async (item) => {
	// Run async task, `item` will be the specific array item.
});

await job.run(); // Will resolve after all tasks are done.

License

This package is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published