@depup/fastq 1.20.1-depup.0 → 1.20.3-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/package.json +9 -7
- package/queue.js +4 -2
- package/test/promise.js +31 -0
- package/test/test.js +75 -0
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/fastq
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [fastq](https://www.npmjs.com/package/fastq) @ 1.20.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [fastq](https://www.npmjs.com/package/fastq) @ 1.20.3 |
|
|
17
|
+
| Processed | 2026-08-29 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 1 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/fastq",
|
|
3
|
-
"version": "1.20.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.20.3-depup.0",
|
|
4
|
+
"description": "Fast, in memory work queue (with updated dependencies)",
|
|
5
5
|
"main": "queue.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"scripts": {
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
"url": "git+https://github.com/mcollina/fastq.git"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
|
-
"depup",
|
|
26
|
-
"dependency-bumped",
|
|
27
|
-
"updated-deps",
|
|
28
25
|
"fastq",
|
|
26
|
+
"depup",
|
|
27
|
+
"updated-dependencies",
|
|
28
|
+
"security",
|
|
29
|
+
"latest",
|
|
30
|
+
"patched",
|
|
29
31
|
"fast",
|
|
30
32
|
"queue",
|
|
31
33
|
"async",
|
|
@@ -59,8 +61,8 @@
|
|
|
59
61
|
},
|
|
60
62
|
"depsUpdated": 1,
|
|
61
63
|
"originalPackage": "fastq",
|
|
62
|
-
"originalVersion": "1.20.
|
|
63
|
-
"processedAt": "2026-
|
|
64
|
+
"originalVersion": "1.20.3",
|
|
65
|
+
"processedAt": "2026-08-29T08:09:52.715Z",
|
|
64
66
|
"smokeTest": "passed"
|
|
65
67
|
}
|
|
66
68
|
}
|
package/queue.js
CHANGED
|
@@ -210,6 +210,7 @@ function fastqueue (context, worker, _concurrency) {
|
|
|
210
210
|
current.value = null
|
|
211
211
|
current.callback = noop
|
|
212
212
|
current.errorHandler = null
|
|
213
|
+
current.next = null
|
|
213
214
|
|
|
214
215
|
// Call error handler if present
|
|
215
216
|
if (errorHandler) {
|
|
@@ -219,8 +220,9 @@ function fastqueue (context, worker, _concurrency) {
|
|
|
219
220
|
// Call callback with error
|
|
220
221
|
callback.call(context, new Error('abort'))
|
|
221
222
|
|
|
222
|
-
//
|
|
223
|
-
|
|
223
|
+
// This task was queued, so return it to the pool without updating
|
|
224
|
+
// the running worker count.
|
|
225
|
+
cache.release(current)
|
|
224
226
|
|
|
225
227
|
current = next
|
|
226
228
|
}
|
package/test/promise.js
CHANGED
|
@@ -290,6 +290,37 @@ test('drained should handle undefined drain function', async function (t) {
|
|
|
290
290
|
t.pass('drained resolved successfully with undefined drain')
|
|
291
291
|
})
|
|
292
292
|
|
|
293
|
+
test('drained waits for running tasks after abort', async function (t) {
|
|
294
|
+
let finish
|
|
295
|
+
let didDrain = false
|
|
296
|
+
|
|
297
|
+
const queue = buildQueue(function () {
|
|
298
|
+
return new Promise(function (resolve) {
|
|
299
|
+
finish = resolve
|
|
300
|
+
})
|
|
301
|
+
}, 1)
|
|
302
|
+
|
|
303
|
+
const running = queue.push(1)
|
|
304
|
+
queue.push(2)
|
|
305
|
+
queue.abort()
|
|
306
|
+
|
|
307
|
+
const drained = queue.drained().then(function () {
|
|
308
|
+
didDrain = true
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
await immediate()
|
|
312
|
+
|
|
313
|
+
t.equal(queue.running(), 1, 'running task is preserved')
|
|
314
|
+
t.equal(didDrain, false, 'queue does not drain while work is running')
|
|
315
|
+
|
|
316
|
+
finish()
|
|
317
|
+
await running
|
|
318
|
+
await drained
|
|
319
|
+
|
|
320
|
+
t.equal(didDrain, true, 'queue drains after running work completes')
|
|
321
|
+
t.equal(queue.running(), 0, 'running returns to zero')
|
|
322
|
+
})
|
|
323
|
+
|
|
293
324
|
test('abort rejects all pending promises', async function (t) {
|
|
294
325
|
const queue = buildQueue(worker, 1)
|
|
295
326
|
const promises = []
|
package/test/test.js
CHANGED
|
@@ -696,6 +696,81 @@ test('abort', function (t) {
|
|
|
696
696
|
}
|
|
697
697
|
})
|
|
698
698
|
|
|
699
|
+
test('abort preserves running count and concurrency', function (t) {
|
|
700
|
+
t.plan(6)
|
|
701
|
+
|
|
702
|
+
var started = []
|
|
703
|
+
var finish = []
|
|
704
|
+
var queue = buildQueue(worker, 1)
|
|
705
|
+
|
|
706
|
+
queue.push(1)
|
|
707
|
+
queue.push(2)
|
|
708
|
+
queue.abort()
|
|
709
|
+
|
|
710
|
+
t.equal(queue.running(), 1, 'running task is preserved')
|
|
711
|
+
|
|
712
|
+
queue.push(3)
|
|
713
|
+
t.deepEqual(started, [1], 'new task does not exceed concurrency')
|
|
714
|
+
|
|
715
|
+
finish.shift()()
|
|
716
|
+
|
|
717
|
+
t.deepEqual(started, [1, 3], 'new task starts after the running task')
|
|
718
|
+
t.equal(queue.running(), 1, 'replacement task is counted')
|
|
719
|
+
|
|
720
|
+
finish.shift()()
|
|
721
|
+
|
|
722
|
+
t.equal(queue.running(), 0, 'running returns to zero')
|
|
723
|
+
t.ok(queue.idle(), 'queue is idle')
|
|
724
|
+
|
|
725
|
+
function worker (task, cb) {
|
|
726
|
+
started.push(task)
|
|
727
|
+
finish.push(function () {
|
|
728
|
+
cb(null, task)
|
|
729
|
+
})
|
|
730
|
+
}
|
|
731
|
+
})
|
|
732
|
+
|
|
733
|
+
test('abort callbacks can safely add tasks', function (t) {
|
|
734
|
+
t.plan(8)
|
|
735
|
+
|
|
736
|
+
var expected = ['active', 'new-1-a', 'new-1-b', 'new-2-a', 'new-2-b']
|
|
737
|
+
var started = []
|
|
738
|
+
var finish = []
|
|
739
|
+
var queue = buildQueue(worker, 1)
|
|
740
|
+
|
|
741
|
+
queue.push('active')
|
|
742
|
+
queue.push('aborted-1', requeue('1'))
|
|
743
|
+
queue.push('aborted-2', requeue('2'))
|
|
744
|
+
queue.abort()
|
|
745
|
+
|
|
746
|
+
t.equal(queue.running(), 1, 'running task is preserved')
|
|
747
|
+
t.equal(queue.length(), 4, 'tasks added by callbacks remain queued')
|
|
748
|
+
t.deepEqual(started, ['active'], 'added tasks wait for the running task')
|
|
749
|
+
|
|
750
|
+
for (var i = 0; i < expected.length; i++) {
|
|
751
|
+
finish.shift()()
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
t.deepEqual(started, expected, 'added tasks are processed once in order')
|
|
755
|
+
t.equal(queue.running(), 0, 'running returns to zero')
|
|
756
|
+
t.ok(queue.idle(), 'queue is idle')
|
|
757
|
+
|
|
758
|
+
function requeue (suffix) {
|
|
759
|
+
return function (err) {
|
|
760
|
+
t.equal(err.message, 'abort', 'callback receives abort error')
|
|
761
|
+
queue.push('new-' + suffix + '-a')
|
|
762
|
+
queue.push('new-' + suffix + '-b')
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
function worker (task, cb) {
|
|
767
|
+
started.push(task)
|
|
768
|
+
finish.push(function () {
|
|
769
|
+
cb(null, task)
|
|
770
|
+
})
|
|
771
|
+
}
|
|
772
|
+
})
|
|
773
|
+
|
|
699
774
|
test('abort with error handler', function (t) {
|
|
700
775
|
t.plan(7)
|
|
701
776
|
|