it-queue
A queue implementation that can be iterated over
Last updated a year ago by achingbrain .
Apache-2.0 OR MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install it-queue 
SYNC missed versions from official npm registry.

it-queue

codecov CI

A queue implementation that can be iterated over

About

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

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)

Install

$ npm i it-queue

Browser <script> tag

Loading this module through a script tag will make its exports available as ItQueue in the global namespace.

<script src="https://unpkg.com/it-queue/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

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.

Current Tags

  • 1.1.4                                ...           latest (5 months ago)

7 Versions

  • 1.1.4                                ...           5 months ago
  • 1.1.3                                ...           8 months ago
  • 1.1.2                                ...           8 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.0.0                                ...           a year ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 0
This Month 17
Last Day 0
Last Week 1
Last Month 0
Dependencies (5)
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE