MCPcopy Create free account
hub / github.com/DavidWells/analytics / asyncQueue

Function asyncQueue

packages/analytics-util-queue/tests/main.test.js:33–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31})
32
33function asyncQueue() {
34 return new Promise((res) => {
35 const timer = new Timer()
36 const queue = smartQueue(noOp, {
37 max: 7,
38 interval: 1000,
39 throttle: true,
40 onEmpty: () => {
41 const timeEnd = timer.runtimeMs()
42 return res(timeEnd)
43 }
44 })
45 addItems(queue, 25)
46 })
47}
48
49test('Processes queue', async () => {
50 const fin = await asyncQueue()

Callers 1

main.test.jsFile · 0.85

Calls 3

runtimeMsMethod · 0.95
smartQueueFunction · 0.85
addItemsFunction · 0.85

Tested by

no test coverage detected