poolifier 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/lib/index.d.ts +14 -902
- package/lib/index.js +1 -1
- package/lib/pools/abstract-pool.d.ts +219 -0
- package/lib/pools/cluster/dynamic.d.ts +30 -0
- package/lib/pools/cluster/fixed.d.ts +64 -0
- package/lib/pools/pool-internal.d.ts +85 -0
- package/lib/pools/pool-worker.d.ts +35 -0
- package/lib/pools/pool.d.ts +73 -0
- package/lib/pools/selection-strategies/abstract-worker-choice-strategy.d.ts +27 -0
- package/lib/pools/selection-strategies/dynamic-pool-worker-choice-strategy.d.ts +27 -0
- package/lib/pools/selection-strategies/fair-share-worker-choice-strategy.d.ts +29 -0
- package/lib/pools/selection-strategies/less-recently-used-worker-choice-strategy.d.ts +15 -0
- package/lib/pools/selection-strategies/round-robin-worker-choice-strategy.d.ts +19 -0
- package/lib/pools/selection-strategies/selection-strategies-types.d.ts +55 -0
- package/lib/pools/selection-strategies/selection-strategies-utils.d.ts +11 -0
- package/lib/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.d.ts +43 -0
- package/lib/pools/selection-strategies/worker-choice-strategy-context.d.ts +48 -0
- package/lib/pools/thread/dynamic.d.ts +31 -0
- package/lib/pools/thread/fixed.d.ts +48 -0
- package/lib/utility-types.d.ts +63 -0
- package/lib/utils.d.ts +8 -0
- package/lib/worker/abstract-worker.d.ts +86 -0
- package/lib/worker/cluster-worker.d.ts +32 -0
- package/lib/worker/thread-worker.d.ts +30 -0
- package/lib/worker/worker-options.d.ts +61 -0
- package/package.json +55 -37
package/README.md
CHANGED
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h2 align="center">Node Thread Pool and Cluster Pool :arrow_double_up: :on:</h2>
|
|
6
|
-
<h2 align="center">
|
|
7
|
-
<a href="https://ko-fi.com/Q5Q31D6QY">
|
|
8
|
-
<img alt="Ko-fi" src="https://ko-fi.com/img/githubbutton_sm.svg"></a>
|
|
9
|
-
</h2>
|
|
10
6
|
|
|
11
7
|
<p align="center">
|
|
12
8
|
<a href="https://www.npmjs.com/package/poolifier">
|
|
@@ -16,11 +12,13 @@
|
|
|
16
12
|
<a href="https://sonarcloud.io/dashboard?id=pioardi_poolifier">
|
|
17
13
|
<img alt="Quality Gate Status" src="https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=alert_status"></a>
|
|
18
14
|
<a href="https://sonarcloud.io/component_measures/metric/coverage/list?id=pioardi_poolifier">
|
|
19
|
-
<img alt="Code
|
|
15
|
+
<img alt="Code Coverage" src="https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=coverage"></a>
|
|
20
16
|
<a href="https://standardjs.com">
|
|
21
17
|
<img alt="Javascript Standard Style Guide" src="https://img.shields.io/badge/code_style-standard-brightgreen.svg"></a>
|
|
22
18
|
<a href="https://gitter.im/poolifier/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge">
|
|
23
19
|
<img alt="Gitter chat" src="https://badges.gitter.im/poolifier/community.svg"></a>
|
|
20
|
+
<a href="https://opencollective.com/poolifier">
|
|
21
|
+
<img alt="Open Collective" src="https://opencollective.com/poolifier/tiers/badge.svg"></a>
|
|
24
22
|
<a href="https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot">
|
|
25
23
|
<img alt="Dependabot" src="https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot"></a>
|
|
26
24
|
<a href="http://makeapullrequest.com">
|
|
@@ -99,7 +97,7 @@ You can implement a worker-threads worker in a simple way by extending the class
|
|
|
99
97
|
'use strict'
|
|
100
98
|
const { ThreadWorker } = require('poolifier')
|
|
101
99
|
|
|
102
|
-
function yourFunction
|
|
100
|
+
function yourFunction(data) {
|
|
103
101
|
// this will be executed in the worker thread,
|
|
104
102
|
// the data will be received by using the execute method
|
|
105
103
|
return { ok: 1 }
|