source: trip-planner-front/node_modules/async/parallelLimit.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = parallelLimit;
7
8var _eachOfLimit = require('./internal/eachOfLimit');
9
10var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
11
12var _parallel = require('./internal/parallel');
13
14var _parallel2 = _interopRequireDefault(_parallel);
15
16function _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 */
37function parallelLimit(tasks, limit, callback) {
38 (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback);
39}
40module.exports = exports['default'];
Note: See TracBrowser for help on using the repository browser.