Sha256: 56818a677dc7565ec745353515e643655a82650bdfc482c31ef8d5191f39a684

Contents?: true

Size: 1.41 KB

Versions: 21

Compression:

Stored size: 1.41 KB

Contents

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = timesLimit;

var _mapLimit = require('./mapLimit');

var _mapLimit2 = _interopRequireDefault(_mapLimit);

var _range = require('./internal/range');

var _range2 = _interopRequireDefault(_range);

var _wrapAsync = require('./internal/wrapAsync');

var _wrapAsync2 = _interopRequireDefault(_wrapAsync);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
 * time.
 *
 * @name timesLimit
 * @static
 * @memberOf module:ControlFlow
 * @method
 * @see [async.times]{@link module:ControlFlow.times}
 * @category Control Flow
 * @param {number} count - The number of times to run the function.
 * @param {number} limit - The maximum number of async operations at a time.
 * @param {AsyncFunction} iteratee - The async function to call `n` times.
 * Invoked with the iteration index and a callback: (n, next).
 * @param {Function} callback - see [async.map]{@link module:Collections.map}.
 * @returns {Promise} a promise, if no callback is provided
 */
function timesLimit(count, limit, iteratee, callback) {
  var _iteratee = (0, _wrapAsync2.default)(iteratee);
  return (0, _mapLimit2.default)((0, _range2.default)(count), limit, _iteratee, callback);
}
module.exports = exports['default'];

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
appmap-0.72.2 ./node_modules/async/timesLimit.js
appmap-0.72.1 ./node_modules/async/timesLimit.js
appmap-0.72.0 ./node_modules/async/timesLimit.js
appmap-0.71.0 ./node_modules/async/timesLimit.js
appmap-0.70.2 ./node_modules/async/timesLimit.js
appmap-0.70.1 ./node_modules/async/timesLimit.js
appmap-0.70.0 ./node_modules/async/timesLimit.js
appmap-0.69.0 ./node_modules/async/timesLimit.js
appmap-0.68.2 ./node_modules/async/timesLimit.js
appmap-0.68.1 ./node_modules/async/timesLimit.js
appmap-0.68.0 ./node_modules/async/timesLimit.js
appmap-0.67.1 ./node_modules/async/timesLimit.js
appmap-0.67.0 ./node_modules/async/timesLimit.js
appmap-0.66.2 ./node_modules/async/timesLimit.js
appmap-0.66.1 ./node_modules/async/timesLimit.js
appmap-0.66.0 ./node_modules/async/timesLimit.js
appmap-0.65.1 ./node_modules/async/timesLimit.js
appmap-0.65.0 ./node_modules/async/timesLimit.js
appmap-0.64.0 ./node_modules/async/timesLimit.js
appmap-0.63.0 ./node_modules/async/timesLimit.js