728x90
nodejs
-
Async 모듈을 이용한 비동기 처리NodeJS 2019. 5. 26. 14:46
얼마전 Node에서 비동기 처리를 순서대로 처리해야 하는 일이 있었다. 구글을 검색하다 async.waterfall in a For Loop in Node.js을 찾았다. var async = require("async") var users = []; // Initialize user array or get it from DB async.forEachLimit(users, 1, function(user, userCallback){ async.waterfall([ function(callback) { callback(null, 'one', 'two'); }, function(arg1, arg2, callback) { // arg1 now equals 'one' a..