Async.series ({
Flag1:function (done) {//FLAG1 is a process ID, user-defined
Logical processing
Done (NULL, "return result")//The first parameter is an exception error, the second parameter returns the result
}
},function (Error,result) {
Final results
Result is a total of returned results, containing all the process controls,
RESULT.FLAG1 can obtain the results of processing in Identity 1
Console.log (Error);
Console.log (result);
if (result.flag1== ' return result ')
{
Console.log (' End ');
}
});
------------------------------------------------
As a small white to see this piece of code is a face of the currency, and now understand to do an analysis.
1.series after the flag1:function format expression is this is a JSON element whose name is Flag1 specific content is the colon after the
What does the content behind 2.FLAG1 mean to be taken out alone?
function (done) {//FLAG1 is a process ID, user-defined
Logical processing
Done (NULL, "return result")//The first parameter is an exception error, the second parameter returns the result
}
Later, it is understood that the arguments passed in after function can be a function, so what it means to do (null, "return result") is to call the function and pass in 2 parameters to simulate the next process.
The function is named one and two respectively.
So it becomes a call to the function to pass in the parameter one and the other is actually a function.
(one);
function One (b,a)
{
Console.log (a);
}
function (done) {//FLAG1 is a process ID, user-defined
Logical processing
Done (NULL, "return result")//The first parameter is an exception error, the second parameter returns the result
};
Nodejs Async Series Small White to