Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

📦 NPM Package - Execute multiple async functions in configurable batches

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages