mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-10 21:01:41 +00:00
update
This commit is contained in:
37
node_modules/fastq/test/example.ts
generated
vendored
Normal file
37
node_modules/fastq/test/example.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
import * as fastq from '../'
|
||||
|
||||
const queue = fastq({ hello: 'world' }, worker, 1)
|
||||
|
||||
queue.push(42, (err, done) => {
|
||||
if (err) throw err
|
||||
console.log('the result is', done)
|
||||
})
|
||||
|
||||
queue.concurrency
|
||||
|
||||
queue.drain()
|
||||
|
||||
queue.empty = () => undefined
|
||||
|
||||
queue.idle()
|
||||
|
||||
queue.kill()
|
||||
|
||||
queue.killAndDrain()
|
||||
|
||||
queue.length
|
||||
|
||||
queue.pause()
|
||||
|
||||
queue.resume()
|
||||
|
||||
queue.saturated = () => undefined
|
||||
|
||||
queue.unshift(42, (err, done) => {
|
||||
if (err) throw err
|
||||
console.log('the result is', done)
|
||||
})
|
||||
|
||||
function worker(arg: any, cb: any) {
|
||||
cb(null, 42 * 2)
|
||||
}
|
Reference in New Issue
Block a user