Based on p-queue but with access to the underlying queue, aborting a task removes it from the queue and you can iterate over the queue results.
p-queue
import all from 'it-all'import { Queue } from 'it-queue'const queue = new Queue({ concurrency: Infinity})void queue.add(async () => { return 'hello'})void queue.add(async () => { return 'world'})const results = await all(queue)// ['hello', 'world']// how many items are in the queue (includes running items)console.info(queue.size)// how many items are runningconsole.info(queue.running)// how many items have not started running yetconsole.info(queue.queued) Copy
import all from 'it-all'import { Queue } from 'it-queue'const queue = new Queue({ concurrency: Infinity})void queue.add(async () => { return 'hello'})void queue.add(async () => { return 'world'})const results = await all(queue)// ['hello', 'world']// how many items are in the queue (includes running items)console.info(queue.size)// how many items are runningconsole.info(queue.running)// how many items have not started running yetconsole.info(queue.queued)
Based on
p-queue
but with access to the underlying queue, aborting a task removes it from the queue and you can iterate over the queue results.Example