Welcome to mirror list, hosted at ThFree Co, Russian Federation.

example.ts « test « fastq « node_modules « assets - github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b188d0cb643c53afa84a8221afc4c975a261edc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)
}