A queue implementation that can be iterated over
npm install it-queue

> A queue implementation that can be iterated over
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.
``ts
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 running
console.info(queue.running)
// how many items have not started running yet
console.info(queue.queued)
`
`console`
$ npm i it-queue
-
Licensed under either of
- Apache 2.0, (LICENSE-APACHE /
- MIT (LICENSE-MIT /
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.