for-limit:并行运行的 for 循环,允许您限制并发操作的数量

时间:2024-07-29 05:59:14
【文件属性】:

文件名称:for-limit:并行运行的 for 循环,允许您限制并发操作的数量

文件大小:6KB

文件格式:ZIP

更新时间:2024-07-29 05:59:14

JavaScript

笔记 目前循环是包容性的。 这意味着如果您传递 1, 100 它将在迭代器调用中同时包含 1 和 100。 示例用法 var forLimit = require('for-limit'); function doSomething(i, next) { setTimeout(function() { console.log('something:', i); next(); }, Math.random() * 1000); // simulate variable time asynchronous function } function allDone(err) { console.log('all done'); } forLimit(1, 100, 10, doSomething, allDone);


【文件预览】:
for-limit-master
----LICENSE(11KB)
----.gitignore(587B)
----index.js(1KB)
----readme.md(510B)
----package.json(627B)

网友评论