Answer the question
In order to leave comments, you need to log in
How to implement passing arbitrary variables to functions within a series (node.js (async.js)) thread?
Good evening.
I need to implement the idea of an approximate plan:
function taskFirst(k, v) {
console.log(k, v);
}
function taskSecond(k, v) {
console.log(k, v);
}
function run() {
var g1 = "Something";
var g2 = "Something";
var g3 = "Something";
var g4 = "Something";
async.series(
[
taskFirst(g1, g2),
taskSecond(g3, g4)
],
function(error, result){
}
);
}
Answer the question
In order to leave comments, you need to log in
Something in style
function taskFirst(k, v, next) {
console.log(k, v);
next(null, 'ok1');
}
function taskSecond(k, v, next) {
console.log(k, v);
next(null, 'ok2');
}
function run() {
var g1 = "Something";
var g2 = "Something";
var g3 = "Something";
var g4 = "Something";
async.series([
taskFirst.bind(null, g1, g2),
taskSecond.bind(null, g3, g4)
], function(error, result){
}
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question