|
|
@ -14,7 +14,7 @@ executor = async.queue(function (task, cb) { |
|
|
|
// Always tell the queue task is complete. Execute callback if any was given.
|
|
|
|
// Always tell the queue task is complete. Execute callback if any was given.
|
|
|
|
if (typeof lastArg === 'function') { |
|
|
|
if (typeof lastArg === 'function') { |
|
|
|
callback = function () { |
|
|
|
callback = function () { |
|
|
|
lastArg(arguments); |
|
|
|
lastArg.apply(null, arguments); |
|
|
|
cb(); |
|
|
|
cb(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -50,11 +50,11 @@ function test2 (msg, cb) { |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function () { |
|
|
|
console.log("Ola " + msg); |
|
|
|
console.log("Ola " + msg); |
|
|
|
callback(); |
|
|
|
callback('YEAH'); |
|
|
|
}, 500); |
|
|
|
}, 500); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function bloup () { console.log("FINISHED"); } |
|
|
|
function bloup () { console.log("FINISHED"); console.log(arguments); } |
|
|
|
|
|
|
|
|
|
|
|
executor.push({ this: null, fn: test1, arguments: [ 'world' ] }); |
|
|
|
executor.push({ this: null, fn: test1, arguments: [ 'world' ] }); |
|
|
|
executor.push({ this: null, fn: test2, arguments: [ 'world', bloup ] }); |
|
|
|
executor.push({ this: null, fn: test2, arguments: [ 'world', bloup ] }); |
|
|
|