root / HServer / 00.Server / 00.Program / node_modules / async / timesLimit.js
이력 | 보기 | 이력해설 | 다운로드 (1.19 KB)
1 | 39 | HKM | 'use strict';
|
---|---|---|---|
2 | |||
3 | Object.defineProperty(exports, "__esModule", {
|
||
4 | value: true |
||
5 | }); |
||
6 | exports.default = timeLimit;
|
||
7 | |||
8 | var _mapLimit = require('./mapLimit'); |
||
9 | |||
10 | var _mapLimit2 = _interopRequireDefault(_mapLimit);
|
||
11 | |||
12 | var _baseRange = require('lodash/_baseRange'); |
||
13 | |||
14 | var _baseRange2 = _interopRequireDefault(_baseRange);
|
||
15 | |||
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
||
17 | |||
18 | /**
|
||
19 | * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
|
||
20 | * time.
|
||
21 | *
|
||
22 | * @name timesLimit
|
||
23 | * @static
|
||
24 | * @memberOf module:ControlFlow
|
||
25 | * @method
|
||
26 | * @see [async.times]{@link module:ControlFlow.times}
|
||
27 | * @category Control Flow
|
||
28 | * @param {number} count - The number of times to run the function.
|
||
29 | * @param {number} limit - The maximum number of async operations at a time.
|
||
30 | * @param {Function} iteratee - The function to call `n` times. Invoked with the
|
||
31 | * iteration index and a callback (n, next).
|
||
32 | * @param {Function} callback - see [async.map]{@link module:Collections.map}.
|
||
33 | */
|
||
34 | function timeLimit(count, limit, iteratee, callback) { |
||
35 | (0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, iteratee, callback); |
||
36 | } |
||
37 | module.exports = exports['default']; |