How to use the waterfall function from async
Find comprehensive JavaScript async.waterfall code examples handpicked from public code repositorys.
GitHub: raawaa/jav-scrapy
![raawaa profile picture](/raawaa.png?size=40)
71 72 73 74 75 76 77 78 79 80
async.during( pageExist, // when page exist function (callback) { async.waterfall( [parseLinks, getItems], function (err) { pageIndex++; if (err) return callback(err);
52 53 54 55 56 57 58 59 60 61
}); }); }); it('should keep the null version if versioning enabled', done => { async.waterfall([ callback => s3.putBucketVersioning({ Bucket: bucket, VersioningConfiguration: versioningEnabled, }, err => callback(err)),
138 139 140 141 142 143 144 145 146 147
next(null, total + n); }; }); var funcs = { 'async': function(callback) { async.waterfall(tasks, callback); }, 'neo-async': function(callback) { neo_async.waterfall(tasks, callback); }
+ 9 other calls in file
GitHub: Souler/I-Wanna-Watch
![Souler profile picture](/Souler.png?size=40)
94 95 96 97 98 99 100 101 102 103
}); }; asyncFns.push(filesFilter); return async.waterfall(asyncFns, cb); } // The script is being run directly if (!module.parent)
124 125 126 127 128 129 130 131 132 133
}); const primaryImageReleaseImageFunc = releaseIds.map(id => createFunctionToGetImageFromReleaseDetails(id, imageCoverPaths)); const getDigitalImageFunctions = imageCoverPaths.concat(primaryImageReleaseImageFunc).map((fn) => { return (cb) => { async.waterfall([fn, function validate(imageUrl, cb) { db.getImage(imageUrl, (error, content) => { if (error) { return cb(error);
87 88 89 90 91 92 93 94 95 96
objectKey: destObjectKey, partNumber: paddedPartNumber, uploadId, }; return async.waterfall([ function checkDestAuth(next) { return metadataValidateBucketAndObj(valPutParams, log, (err, destBucketMD) => { if (err) {
+ 5 other calls in file
410 411 412 413 414 415 416 417 418 419
console.log("1 error getting scene data: " + err); res.end(); } else { let accessScene = true; // sceneData = sceneData; // async.waterfall([ // function (callback) { // //TODO use sceneNetworkSettings or whatever // socketScripts = "<script src=\x22/connect/connect.js\x22 defer=\x22defer\x22></script>" + // "<script src=\x22//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\x22></script>" +
956 957 958 959 960 961 962 963 964 965
* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be * invoked with `(args..., callback)`. * @example * * // passing a regular synchronous function * async.waterfall([ * async.apply(fs.readFile, filename, "utf8"), * async.asyncify(JSON.parse), * function (data, next) { * // data is the result of parsing the text.
+ 11 other calls in file
GitHub: artilleryio/artillery
127 128 129 130 131 132 133 134 135 136
return next(null, initialContext); }; let steps = [init].concat(tasks); A.waterfall( steps, function done(err, context) { if (err) { debug(err);
200 201 202 203 204 205 206 207 208 209 210 211
const middlewareList = _.clone(middlewareCollection); middlewareList.unshift(emptyMiddleware); middlewareList.push(endMiddleware); async.waterfall(middlewareList, callback); } else { callback(null, entity); } }
+ 3 other calls in file
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
query: request.query, }); return responseJSONBody(errors.MethodNotAllowed, null, response, log); } return async.waterfall([next => auth.server.doAuth( request, log, (err, userInfo) => { if (err) { log.debug('authentication error', { error: err,
18 19 20 21 22 23 24 25 26 27
shop_info.forEach(element => { task.push((cb) => { getOrder(element, cb) }) }); async.waterfall(task, function (err, result) { if (err) { console.log(err); } console.log("订单同步 完成!")
async.parallel is the most popular function in async (1226 examples)