dong-queue
v0.1.1
Published
simple async queue runner
Downloads
9
Readme
dong-queue
simple (a)sync queue runner
Install
npm install --save dong-queue
Usage
run
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
}])
any
asynchronous. if any member of the queue is finished, call the callback.
all
asynchronous. if all members of the queue is finished, call the callback.