parallel-executors
v1.0.11
Published
[](https://badge.fury.io/js/parallel-executors) []() [.execute();
run executors for all tasks in an iterable object
function* sources(count: number) {
for (let i = 0; i < count; i++) {
yield i;
}
}
await new ParallelExecutor(sources(100), {
workers: 10,
executor: async (item: number) => {
console.log(item);
await sleep(10);
}
}).execute();
Notice
- Any task executor rejects may cause ParallelExecutor terminate.
- Task executor returns true value can break the ParallelExecutor process.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
