root / HServer / 00.Server / 00.Program / node_modules / async / eachOfLimit.js
이력 | 보기 | 이력해설 | 다운로드 (1.44 KB)
1 | 39 | HKM | 'use strict';
|
---|---|---|---|
2 | |||
3 | Object.defineProperty(exports, "__esModule", {
|
||
4 | value: true |
||
5 | }); |
||
6 | exports.default = eachOfLimit;
|
||
7 | |||
8 | var _eachOfLimit2 = require('./internal/eachOfLimit'); |
||
9 | |||
10 | var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
|
||
11 | |||
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
||
13 | |||
14 | /**
|
||
15 | * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
|
||
16 | * time.
|
||
17 | *
|
||
18 | * @name eachOfLimit
|
||
19 | * @static
|
||
20 | * @memberOf module:Collections
|
||
21 | * @method
|
||
22 | * @see [async.eachOf]{@link module:Collections.eachOf}
|
||
23 | * @alias forEachOfLimit
|
||
24 | * @category Collection
|
||
25 | * @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||
26 | * @param {number} limit - The maximum number of async operations at a time.
|
||
27 | * @param {Function} iteratee - A function to apply to each
|
||
28 | * item in `coll`. The `key` is the item's key, or index in the case of an
|
||
29 | * array. The iteratee is passed a `callback(err)` which must be called once it
|
||
30 | * has completed. If no error has occurred, the callback should be run without
|
||
31 | * arguments or with an explicit `null` argument. Invoked with
|
||
32 | * (item, key, callback).
|
||
33 | * @param {Function} [callback] - A callback which is called when all
|
||
34 | * `iteratee` functions have finished, or an error occurs. Invoked with (err).
|
||
35 | */
|
||
36 | function eachOfLimit(coll, limit, iteratee, callback) { |
||
37 | (0, _eachOfLimit3.default)(limit)(coll, iteratee, callback); |
||
38 | } |
||
39 | module.exports = exports['default']; |