<p align="center">
<a href="https://www.npmjs.com/package/poolifier">
<img alt="Weekly Downloads" src="https://img.shields.io/npm/dw/poolifier"></a>
- <a href="https://github.com/pioardi/node-pool/actions">
- <img alt="Actions Status" src="https://github.com/pioardi/node-pool/workflows/NodeCI/badge.svg"></a>
+ <a href="https://github.com/poolifier/poolifier/actions">
+ <img alt="Actions Status" src="https://github.com/poolifier/poolifier/workflows/NodeCI/badge.svg"></a>
<a href="https://sonarcloud.io/dashboard?id=pioardi_poolifier">
<img alt="Quality Gate Status" src="https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=alert_status"></a>
<a href="https://sonarcloud.io/component_measures/metric/coverage/list?id=pioardi_poolifier">
<img alt="Javascript Standard Style Guide" src="https://img.shields.io/badge/code_style-standard-brightgreen.svg"></a>
<a href="https://gitter.im/poolifier/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge">
<img alt="Gitter chat" src="https://badges.gitter.im/poolifier/community.svg"></a>
- <a href="https://badgen.net/dependabot/dependabot/dependabot-core/?icon=dependabot">
- <img alt="Dependabot" src="https://badgen.net/dependabot/dependabot/dependabot-core/?icon=dependabot"></a>
+ <a href="https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot">
+ <img alt="Dependabot" src="https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot"></a>
<a href="http://makeapullrequest.com">
<img alt="PR Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square"></a>
<a href="https://img.shields.io/static/v1?label=dependencies&message=no%20dependencies&color=brightgreen">
<span> · </span>
<a href="#usage">Usage</a>
<span> · </span>
- <a href="#node-versions"> Node versions</a>
+ <a href="#node-versions">Node versions</a>
<span> · </span>
<a href="#api">API</a>
<span> · </span>
## Node versions
-You can use node versions 12.x, 13.x, 14.x, 16.x
+You can use node versions >= 12.x for thread pool, and node versions >= 16.x for cluster pool.
## API
- `WorkerChoiceStrategies.ROUND_ROBIN`: Submit tasks to worker in this pool in a round robbin fashion
- `WorkerChoiceStrategies.LESS_RECENTLY_USED`: Submit tasks to the less recently used worker in the pool
+ - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` Submit tasks to worker using a weighted round robin scheduling algorithm based on tasks execution time for now
+ - `WorkerChoiceStrategies.FAIR_SHARE`: Submit tasks to worker using a fair share tasks scheduling algorithm
Default: `WorkerChoiceStrategies.ROUND_ROBIN`
The last active time of your worker unit will be updated when a task is submitted to a worker or when a worker terminate a task.
If `killBehavior` is set to `KillBehaviors.HARD` this value represents also the timeout for the tasks that you submit to the pool, when this timeout expires your tasks is interrupted and the worker is killed if is not part of the minimum size of the pool.
If `killBehavior` is set to `KillBehaviors.SOFT` your tasks have no timeout and your workers will not be terminated until your task is completed.
- Default: 60.000 ms
+ Default: 60000 ms
- `async` - true/false, true if your function contains async pieces else false
- `killBehavior` - Dictates if your async unit (worker/process) will be deleted in case that a task is active on it.
## Contribute
See guidelines [CONTRIBUTING](CONTRIBUTING.md)
-Choose your task here [2.0.0](https://github.com/pioardi/poolifier/projects/1), propose an idea, a fix, an improvement.
+Choose your task here [2.3.0](https://github.com/orgs/poolifier/projects/1), propose an idea, a fix, an improvement.
## Team
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
-<!-- prettier-ignore-start -->
-<!-- markdownlint-disable -->
**Creator/Owner:**