MCPcopy
hub / github.com/caolan/async / nextTask

Function nextTask

lib/waterfall.js:72–88  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

70 var taskIndex = 0;
71
72 function nextTask(args) {
73 if (taskIndex === tasks.length) {
74 return callback.apply(null, [null].concat(args));
75 }
76
77 var taskCallback = onlyOnce(rest(function(err, args) {
78 if (err) {
79 return callback.apply(null, [err].concat(args));
80 }
81 nextTask(args);
82 }));
83
84 args.push(taskCallback);
85
86 var task = wrapAsync(tasks[taskIndex++]);
87 task.apply(null, args);
88 }
89
90 nextTask([]);
91}

Callers 1

waterfall.jsFile · 0.85

Calls 3

onlyOnceFunction · 0.85
restFunction · 0.85
wrapAsyncFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…