The issue is similar to #90, but in my case I used kill() to empty the queue.
I was trying to implement queue abortion which should eventualy be a combination of queue.kill() and abortController.abort(). However, I noticed an unexpected behavior: the promises returned from promise-based push() was never resolved.
Additionally, the terminal displayed the following warning:
Warning: Detected unsettled top-level await at...
My question is: shouldn't fastq eventualy either resolve or reject such promises?
Here's a minimal reproducible example:
import { promise } from 'fastq'
import { setTimeout } from 'node:timers/promises'
const queue = promise(doWork, 1)
const promises = []
for(let i = 0; i < 10; i++) {
promises.push(queue.push())
}
queue.kill()
await Promise.all(promises)
console.log('never logged')
async function doWork() {
await setTimeout(500)
}
The issue is similar to #90, but in my case I used
kill()to empty the queue.I was trying to implement queue abortion which should eventualy be a combination of
queue.kill()andabortController.abort(). However, I noticed an unexpected behavior: the promises returned from promise-basedpush()was never resolved.Additionally, the terminal displayed the following warning:
My question is: shouldn't
fastqeventualy either resolve or reject such promises?Here's a minimal reproducible example: