0.1.1 • Published 9 years ago

dong-queue v0.1.1

Weekly downloads
4
License
-
Repository
github
Last release
9 years ago

dong-queue

NPM version Build Status

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.