# @rodrigogs/promise-pool

> This promise pool keeps looping `Promise.all`'s promises until the last generator item is submitted to the processor.

Latest version **2.0.0** (published 2021-03-24) · bsd-3-clause license · 0 weekly downloads

## Install

```sh
npm install @rodrigogs/promise-pool
pnpm add @rodrigogs/promise-pool
yarn add @rodrigogs/promise-pool
bun add @rodrigogs/promise-pool
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-03-24 |
| First published | 2020-01-31 |
| Weekly downloads | 0 |
| License | bsd-3-clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Rodrigo Gomes da Silva |
| Maintainers | rodrigogs |
| Keywords | promise, pool, poller, generator, async |

## Links

- npm: https://www.npmjs.com/package/@rodrigogs/promise-pool
- Repository: https://github.com/rodrigogs/promise-pool
- Homepage: https://github.com/rodrigogs/promise-pool#readme
- Issues: https://github.com/rodrigogs/promise-pool/issues
- npm.io page: https://npm.io/package/@rodrigogs/promise-pool

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-03-24
- 1.0.4 — 2020-11-01
- 1.0.3 — 2020-02-10
- 1.0.2 — 2020-02-10
- 1.0.1 — 2020-01-31

## README

# promise-pool
This promise pool keeps looping `Promise.all`'s promises until the last generator item is submitted to the processor.

## Install
`$ npm install @rodrigogs/promise-pool`

## Usage
```javascript
const promisePool = require('@rodrigogs/promise-pool');
 
function* generatorFunction(start, end) { // Could be an async generator
  for (let i = start; i <= end; i += 1) {
    yield i;
  }
}

function processor(generatorValue) { // Could be an async function
  console.log(generatorValue);
}

(async () => {
  await promisePool({
    generator: generatorFunction(100, 1000),
    processor,
    concurrency: 10,
  });
})();
```

## License
[BSD-3-Clause](https://github.com/rodrigogs/promise-pool/blob/master/LICENSE) © Rodrigo Gomes da Silva

---
_Source: https://npm.io/package/@rodrigogs/promise-pool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
