Example :
let counter = 0; const queue = new Kiwi(job => { counter++; }); await queue.clear(); //clean previous jobs await queue.add('foo'); //add job with 'foo' as data queue.start(); await queue.idle(); //await queue is empty console.log(await queue.isEmpty()); //check is empty
Async function invoked by kiwi on each job. Should throw an exception if job failed.
Configure kiwi queue
since v4.0.0
Generated using TypeDoc
Example :
let counter = 0; const queue = new Kiwi(job => { counter++; }); await queue.clear(); //clean previous jobs await queue.add('foo'); //add job with 'foo' as data queue.start(); await queue.idle(); //await queue is empty console.log(await queue.isEmpty()); //check is empty