PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` import * as fastq from '../' import { promise as queueAsPromised } from '../' // Basic example const queue = fastq(worker, 1) queue.push('world', (err, result) => { if (err) throw err console.log('the result is', result) }) queue.push('push without cb') queue.concurrency queue.drain() queue.empty = () => undefined console.log('the queue tasks are', queue.getQueue()) queue.idle() queue.kill() queue.killAndDrain() queue.length queue.pause() queue.resume() queue.saturated = () => undefined queue.unshift('world', (err, result) => { if (err) throw err console.log('the result is', result) }) queue.unshift('unshift without cb') function worker(task: any, cb: fastq.done) { cb(null, 'hello ' + task) } // Generics example interface GenericsContext { base: number; } const genericsQueue = fastq({ base: 6 }, genericsWorker, 1) genericsQueue.push(7, (err, done) => { if (err) throw err console.log('the result is', done) }) genericsQueue.unshift(7, (err, done) => { if (err) throw err console.log('the result is', done) }) function genericsWorker(this: GenericsContext, task: number, cb: fastq.done) { cb(null, 'the meaning of life is ' + (this.base * task)) } const queue2 = queueAsPromised(asyncWorker, 1) async function asyncWorker(task: any) { return 'hello ' + task } async function run () { await queue.push(42) await queue.unshift(42) } run()