parent
2c4db660cf
commit
089a6eaf50
@ -0,0 +1,22 @@ |
||||
"use strict"; |
||||
|
||||
var async = require("async"); |
||||
|
||||
var series = function (tasks, callback) { |
||||
console.log("arguments:"); |
||||
console.log(arguments); |
||||
console.log("first task:"); |
||||
console.log(tasks[0]); |
||||
tasks[0]("xxx"); |
||||
console.log("executed tasks[0]"); |
||||
async.series(tasks, callback); |
||||
} |
||||
|
||||
module.exports = function (params, processor) { |
||||
var mapper = Function.bind.bind(processor.processTask, processor); |
||||
return { |
||||
process: function () { |
||||
async.series(params.tasks.map(function (element) { return mapper(element); }), processor.done.bind(processor)); |
||||
} |
||||
}; |
||||
}; |
Loading…
Reference in new issue