How to use the whilst function from async
Find comprehensive JavaScript async.whilst code examples handpicked from public code repositorys.
GitHub: iHRIS/iHRIS
68 69 70 71 72 73 74 75 76 77
let resources = ["Basic", "Questionnaire", "Parameters"] const promises = [] for(let resource of resources) { promises.push(new Promise((resolve1) => { let params = {} async.whilst( (callback) => { return callback(null, nxturl !== false) }, (callback) => {
25
26
8
+ 10 other calls in file
GitHub: scality/Arsenal
14 15 16 17 18 19 20 21 22 23
* @param {Function} cb - callback * @returns {undefined} */ function putBulkObjectVersions(metadata, bucketName, objName, objVal, params, versionNb, timestamp, logger, cb) { let count = 0; return async.whilst( () => count < versionNb, cbIterator => { count++; const lastModified = new Date(timestamp + count).toISOString();
17
13
56
6001 6002 6003 6004 6005 6006 6007 6008 6009 6010
* callback. Invoked with (err, [results]); * @returns undefined * @example * * var count = 0; * async.whilst( * function() { return count < 5; }, * function(callback) { * count++; * setTimeout(function() {
0
2
1
GitHub: modeverv/musicdb_dev
224 225 226 227 228 229 230 231 232 233
names = Object.keys(this.stores), self = this, response, mergeObjs = []; async.whilst(function () { return typeof response === 'undefined' && current < names.length; }, function (next) { var store = self.stores[names[current]]; current++;
0
0
2
796 797 798 799 800 801 802 803 804
} }; async.doWhilst = function (iterator, test, callback) { var calls = 0; return async.whilst(function() { return ++calls <= 1 || test.apply(this, arguments); }, iterator, callback); };
0
0
1
+ 43 other calls in file
async.parallel is the most popular function in async (1226 examples)