PluginProbe
Force Refresh / 2.1.0
Force Refresh v2.1.0
3.2.1 3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 All 54 releases
force-refresh / node_modules / handlebars / node_modules / async / parallelLimit.js

parallelLimit.js in Force Refresh 2.1.0, at node_modules/handlebars/node_modules/async/parallelLimit.js

40 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 'use strict';
2
3 Object.defineProperty(exports, "__esModule", {
4 value: true
5 });
6 exports.default = parallelLimit;
7
8 var _eachOfLimit = require('./internal/eachOfLimit');
9
10 var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
11
12 var _parallel = require('./internal/parallel');
13
14 var _parallel2 = _interopRequireDefault(_parallel);
15
16 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18 /**
19 * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a
20 * time.
21 *
22 * @name parallelLimit
23 * @static
24 * @memberOf module:ControlFlow
25 * @method
26 * @see [async.parallel]{@link module:ControlFlow.parallel}
27 * @category Control Flow
28 * @param {Array|Iterable|Object} tasks - A collection of
29 * [async functions]{@link AsyncFunction} to run.
30 * Each async function can complete with any number of optional `result` values.
31 * @param {number} limit - The maximum number of async operations at a time.
32 * @param {Function} [callback] - An optional callback to run once all the
33 * functions have completed successfully. This function gets a results array
34 * (or object) containing all the result arguments passed to the task callbacks.
35 * Invoked with (err, results).
36 */
37 function parallelLimit(tasks, limit, callback) {
38 (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback);
39 }
40 module.exports = exports['default'];