simple (a)sync queue runner
npm install --save dong-queue
synchronous. run queue member step by step (one invokes by previous one with next
).
var queue = new Queue()
// use function
queue.use(function([arg1, arg2, ...], next){
// do some (a)sync job, then
next()
})
// use functions
queue.use([function([arg1, arg2, ...], next){
// do some (a)sync job, then
next()
}, ...])
// dynamically pass arguments to queue members
queue.run([arg1, arg2, ... ], [function callback([arg1, arg2, ... ]) {
// do some callbacks
}])
asynchronous. if any member of the queue is finished, call the callback.
asynchronous. if all members of the queue is finished, call the callback.