How to use the waterfall function from async

Find comprehensive JavaScript async.waterfall code examples handpicked from public code repositorys.

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);
fork icon214
star icon974
watch icon47

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)),
fork icon238
star icon0
watch icon89

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);
    }
fork icon45
star icon0
watch icon0

+ 9 other calls in file

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)
fork icon0
star icon3
watch icon2

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);
fork icon0
star icon2
watch icon1

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) {
fork icon238
star icon0
watch icon89

+ 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>" +
fork icon1
star icon3
watch icon2

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.
fork icon0
star icon2
watch icon1

+ 11 other calls in file

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);
fork icon436
star icon0
watch icon59

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);
    }
}
fork icon74
star icon56
watch icon23

+ 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,
fork icon236
star icon0
watch icon89

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("订单同步完成!")
fork icon0
star icon0
watch icon1