execQ
pending the commands and execute them in a right time.
used in project RocketEngine
Install
npm install execq
Usages
var execQ = 'execq'; execQ;execQ;execQ;execQ;execQ
API
// init the max pending-queue lenghtvar execQ = 'exdecq'maxlen;
maxlen
default to 1000
// get pending queue's lengthexecQlength // => x
// add a job to pending-queueexecQ;
- operation {Array | Function}
ex:
// arrayobject
// execute a series of pended commands with a seqnumexecQ;
execute the commands from the seqnum
- seqnum {Number} (option)
// clean the pending-queueexecQ;
execQ will emit event pending
on invoking .pend()
, and emit event continue
on finish invoking .goon()