Commit | Line | Data |
---|---|---|
522eea03 | 1 | # Changelog |
2 | ||
3 | All notable changes to this project will be documented in this file. | |
4 | ||
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |
7 | ||
45a5a54c JB |
8 | ## [Unreleased] |
9 | ||
ed6dd37f JB |
10 | ### Changed |
11 | ||
12 | - Introduce ESM module support along with CommonJS one. | |
13 | ||
14 | ### Fixed | |
15 | ||
16 | - Fix brown paper bag bug referencing the same object literal. | |
17 | ||
68e2ad86 JB |
18 | ## [2.3.8] - 2023-03-18 |
19 | ||
ca6c7d70 JB |
20 | ### Changed |
21 | ||
22 | - Switch internal benchmarking code to benny. | |
fbdedeb9 JB |
23 | - Switch to TypeScript 5.x.x. |
24 | - Switch rollup bundler plugins to core ones. | |
ed6dd37f | 25 | - Switch to TSDoc syntax. |
fbdedeb9 | 26 | - Enforce conventional commits. |
ca6c7d70 | 27 | |
d15211d4 JB |
28 | ### Fixed |
29 | ||
30 | - Fix random integer generator. | |
fbdedeb9 | 31 | - Fix worker choice strategy pool type identification at initialization. |
d15211d4 | 32 | |
995705ea JB |
33 | ## [2.3.7] - 2022-10-23 |
34 | ||
b953022b JB |
35 | ### Changed |
36 | ||
37 | - Switch to open collective FOSS project funding platform. | |
78cea37e JB |
38 | - Switch to ts-standard linter configuration on TypeScript code. |
39 | ||
40 | ### Fixed | |
41 | ||
42 | - Fixed missing async on pool execute method. | |
43 | - Fixed typing in TypeScript example. | |
44 | - Fixed types in unit tests. | |
b953022b | 45 | |
3b9f6953 JB |
46 | ## [2.3.6] - 2022-10-22 |
47 | ||
f80cead4 JB |
48 | ### Changed |
49 | ||
50 | - Cleanup pool attributes and methods. | |
51 | - Refine error types thrown. | |
52 | ||
53 | ### Fixed | |
54 | ||
55 | - Fix continuous integration build on windows. | |
56 | - Fix code coverage reporting by using c8 instead of nyc. | |
57 | ||
efc22107 JB |
58 | ## [2.3.5] - 2022-10-21 |
59 | ||
7a6a0a96 JB |
60 | ### Changed |
61 | ||
a05c10de JB |
62 | - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter. |
63 | - Optimize tasks usage lookup implementation. | |
7a6a0a96 | 64 | |
b4904890 JB |
65 | ### Fixed |
66 | ||
67 | - Fix missed pool event emitter type export. | |
68 | - Fix typedoc documentation generation. | |
69 | ||
a875f8d1 JB |
70 | ## [2.3.4] - 2022-10-17 |
71 | ||
73cda448 JB |
72 | ### Added |
73 | ||
74 | - Fully automate release process with release-it. | |
75 | ||
45a5a54c JB |
76 | ### Changed |
77 | ||
73cda448 | 78 | - Optimize fair share task scheduling algorithm implementation. |
eb4a8a82 | 79 | - Update benchmarks versus external pools results with latest version. |
45a5a54c | 80 | |
90ee1b18 | 81 | ## [2.3.3] - 2022-10-15 |
1a76932b JB |
82 | |
83 | ### Added | |
84 | ||
85 | - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options. | |
86 | ||
90ee1b18 | 87 | ## [2.3.2] - 2022-10-14 |
11df3590 JB |
88 | |
89 | ### Changed | |
90 | ||
91 | - Optimize fair share worker selection strategy implementation. | |
92 | ||
93 | ### Fixed | |
94 | ||
95 | - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled. | |
96 | ||
90ee1b18 | 97 | ## [2.3.1] - 2022-10-13 |
23ff945a JB |
98 | |
99 | ### Added | |
100 | ||
101 | - Pool worker choice strategies: | |
102 | - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now. | |
103 | - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now. | |
104 | ||
90ee1b18 | 105 | ## [2.2.2] - 2022-10-09 |
cb2b6c69 JB |
106 | |
107 | ### Fixed | |
108 | ||
109 | - Fixed `README.md` file. | |
110 | ||
90ee1b18 | 111 | ## [2.2.1] - 2022-10-08 |
bdacc2d2 | 112 | |
bdaf31cd JB |
113 | ### Added |
114 | ||
115 | - Dynamic worker choice strategy change at runtime. | |
bdacc2d2 | 116 | |
90ee1b18 | 117 | ## [2.2.0] - 2022-01-05 |
7e0d447f JB |
118 | |
119 | ### Breaking Changes | |
120 | ||
121 | - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version. | |
122 | ||
90ee1b18 | 123 | ## [2.1.0] - 2021-08-29 |
35cf1c03 JB |
124 | |
125 | ### Added | |
126 | ||
127 | - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker. | |
e088a00c JB |
128 | |
129 | ### Breaking Changes | |
130 | ||
131 | - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute. | |
132 | - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`. | |
133 | - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`. | |
c365b2d3 | 134 | - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker. |
e088a00c | 135 | |
90ee1b18 | 136 | ## [2.0.2] - 2021-05-12 |
14916bf9 JB |
137 | |
138 | ### Bug fixes | |
139 | ||
140 | - Fix `busy` event emission on fixed pool type | |
141 | ||
90ee1b18 | 142 | ## [2.0.1] - 2021-03-16 |
7f685093 JB |
143 | |
144 | ### Bug fixes | |
145 | ||
146 | - Check if pool options are properly set. | |
147 | - `busy` event is emitted on all pool types. | |
148 | ||
90ee1b18 | 149 | ## [2.0.0] - 2021-03-01 |
fa0f5b28 | 150 | |
f3f833ab | 151 | ### Bug fixes |
d63d3be3 | 152 | |
ddbeaffd | 153 | - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70). |
d63d3be3 | 154 | |
fa0f5b28 S |
155 | ### Breaking Changes |
156 | ||
7f685093 | 157 | - `FullPool` event is now renamed to `busy`. |
1927ee67 | 158 | - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`. |
1a81f8af | 159 | _Find more details on our JSDoc._ |
ddbeaffd | 160 | |
1927ee67 APA |
161 | - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed. |
162 | ||
ddbeaffd | 163 | - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes. |
fa0f5b28 | 164 | |
ec2ccfc8 JB |
165 | ### Pool options types declaration merge |
166 | ||
167 | `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`. | |
168 | ||
fa0f5b28 S |
169 | #### New `export` strategy |
170 | ||
171 | ```js | |
172 | // Before | |
777b7824 | 173 | const DynamicThreadPool = require('poolifier/lib/dynamic') |
fa0f5b28 | 174 | // After |
777b7824 | 175 | const { DynamicThreadPool } = require('poolifier/lib/dynamic') |
fa0f5b28 S |
176 | ``` |
177 | ||
178 | But you should always prefer just using | |
179 | ||
180 | ```js | |
777b7824 | 181 | const { DynamicThreadPool } = require('poolifier') |
fa0f5b28 S |
182 | ``` |
183 | ||
d3c8a1a8 S |
184 | #### New type definitions for input data and response |
185 | ||
ec2ccfc8 | 186 | For cluster worker and worker-thread pools, you can now only send and receive serializable data. |
d3c8a1a8 S |
187 | _This is not a limitation by poolifier but NodeJS._ |
188 | ||
3a4b605f | 189 | #### Public property replacements |
5c5a1fb7 | 190 | |
3a4b605f | 191 | `numWorkers` property is now `numberOfWorkers` |
5c5a1fb7 | 192 | |
280c2a77 | 193 | #### Internal (protected) properties and methods renaming |
fa0f5b28 | 194 | |
280c2a77 S |
195 | These properties are not intended for end users |
196 | ||
197 | - `id` => `nextMessageId` | |
198 | ||
199 | These methods are not intended for end users | |
fa0f5b28 S |
200 | |
201 | - `_chooseWorker` => `chooseWorker` | |
280c2a77 | 202 | - `_newWorker` => `createWorker` |
fa0f5b28 S |
203 | - `_execute` => `internalExecute` |
204 | - `_chooseWorker` => `chooseWorker` | |
205 | - `_checkAlive` => `checkAlive` | |
206 | - `_run` => `run` | |
207 | - `_runAsync` => `runAsync` | |
208 | ||
90ee1b18 | 209 | ## [1.1.0] - 2020-05-21 |
0312f71a APA |
210 | |
211 | ### Added | |
212 | ||
213 | - ThreadWorker support async functions as option | |
cf9aa6c3 | 214 | - Various external library patches |
0312f71a | 215 | |
90ee1b18 | 216 | ## [1.0.0] - 2020-01-24 |
522eea03 | 217 | |
218 | ### Added | |
219 | ||
220 | - FixedThreadPool implementation | |
221 | - DynamicThreadPool implementation | |
0312f71a | 222 | - WorkerThread implementation to improve developer experience |