Commit | Line | Data |
---|---|---|
522eea03 | 1 | # Changelog |
2 | ||
3 | All notable changes to this project will be documented in this file. | |
4 | ||
d4abc60a | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
522eea03 | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
7 | ||
45a5a54c JB |
8 | ## [Unreleased] |
9 | ||
9fb0f324 JB |
10 | ## [2.4.3] - 2023-04-07 |
11 | ||
28cf3617 JB |
12 | ### Fixed |
13 | ||
14 | - Fix typedoc generation with inheritance. | |
15 | ||
848f0f27 JB |
16 | ## [2.4.2] - 2023-04-06 |
17 | ||
164d950a JB |
18 | ### Added |
19 | ||
20 | - Add `full` event to dynamic pool. | |
32417142 | 21 | - Keep worker choice strategy in memory for conditional reuse. |
164d950a | 22 | |
78ab2555 JB |
23 | ### Fixed |
24 | ||
25 | - Fix possible negative worker key at worker removal in worker choice strategies. | |
26 | ||
79aafe9f JB |
27 | ## [2.4.1] - 2023-04-05 |
28 | ||
9cd39dd4 JB |
29 | ### Changed |
30 | ||
31 | - Optimize worker choice strategy for dynamic pool. | |
32 | ||
965415bb JB |
33 | ### Fixed |
34 | ||
35 | - Ensure dynamic pool does not alter worker choice strategy expected behavior. | |
36 | ||
d8b60b1c JB |
37 | ## [2.4.0] - 2023-04-04 |
38 | ||
c6bd2650 JB |
39 | ### Added |
40 | ||
41 | - Add `LESS_BUSY` worker choice strategy. | |
42 | ||
43 | ### Changed | |
44 | ||
45 | - Optimize worker storage in pool. | |
46 | - Optimize worker alive status check. | |
47 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
48 | - Optimize `LESS_USED` worker choice strategy. | |
49 | - Update benchmarks versus external threads pools. | |
50 | - Optimize tasks usage statistics requirements for worker choice strategy. | |
51 | ||
52 | ### Fixed | |
53 | ||
54 | - Ensure trimmable characters are checked at pool initialization. | |
55 | - Fix message id integer overflow. | |
56 | - Fix pool worker removal in worker choice strategy internals. | |
57 | - Fix package publication with pnpm. | |
58 | ||
d0a3f018 JB |
59 | ## [2.4.0-3] - 2023-04-04 |
60 | ||
b2ede285 JB |
61 | ### Added |
62 | ||
63 | - Add `LESS_BUSY` worker choice strategy. | |
64 | ||
65 | ### Changed | |
66 | ||
67 | - Optimize worker storage in pool. | |
68 | - Optimize worker alive status check. | |
69 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
70 | - Optimize `LESS_USED` worker choice strategy. | |
71 | - Update benchmarks versus external threads pools. | |
72 | ||
73 | ### Fixed | |
74 | ||
75 | - Ensure trimmable characters are checked at pool initialization. | |
76 | - Fix message id integer overflow. | |
77 | - Fix pool worker removal in worker choice strategy internals. | |
78 | - Fix package publication with pnpm. | |
79 | ||
a015ea40 JB |
80 | ## [2.4.0-2] - 2023-04-03 |
81 | ||
698f4bbc JB |
82 | ### Added |
83 | ||
84 | - Add `LESS_BUSY` worker choice strategy. | |
85 | ||
86 | ### Changed | |
87 | ||
88 | - Optimize worker storage in pool. | |
89 | - Optimize worker alive status check. | |
90 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
91 | - Optimize `LESS_USED` worker choice strategy. | |
92 | ||
93 | ### Fixed | |
94 | ||
95 | - Ensure trimmable characters are checked at pool initialization. | |
96 | - Fix message id integer overflow. | |
97 | - Fix pool worker removal in worker choice strategy internals. | |
98 | - Fix package publication with pnpm. | |
99 | ||
8fe15920 JB |
100 | ## [2.4.0-1] - 2023-04-03 |
101 | ||
5b301c28 JB |
102 | ### Added |
103 | ||
104 | - Add `LESS_BUSY` worker choice strategy. | |
105 | ||
106 | ### Changed | |
107 | ||
108 | - Optimize worker storage in pool. | |
109 | - Optimize worker alive status check. | |
110 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
111 | - Optimize `LESS_USED` worker choice strategy. | |
112 | ||
113 | ### Fixed | |
114 | ||
115 | - Ensure trimmable characters are checked at pool initialization. | |
116 | - Fix message id integer overflow. | |
117 | - Fix pool worker removal in worker choice strategy internals. | |
118 | ||
2fb9ca9c JB |
119 | ## [2.4.0-0] - 2023-04-03 |
120 | ||
168c526f JB |
121 | ### Added |
122 | ||
123 | - Add `LESS_BUSY` worker choice strategy. | |
124 | ||
1d71a908 JB |
125 | ### Changed |
126 | ||
ffcbbad8 | 127 | - Optimize worker storage in pool. |
1d71a908 | 128 | - Optimize worker alive status check. |
65a60b3b | 129 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. |
737c6d97 | 130 | - Optimize `LESS_USED` worker choice strategy. |
1d71a908 | 131 | |
ffcbbad8 JB |
132 | ### Fixed |
133 | ||
134 | - Ensure trimmable characters are checked at pool initialization. | |
b4e75778 | 135 | - Fix message id integer overflow. |
97a2abc3 | 136 | - Fix pool worker removal in worker choice strategy internals. |
ffcbbad8 | 137 | |
08372738 JB |
138 | ## [2.3.10] - 2023-03-18 |
139 | ||
710826bc JB |
140 | ### Fixed |
141 | ||
142 | - Fix `exports` syntax for ESM and CommonJS. | |
143 | ||
144 | ### Changed | |
145 | ||
146 | - Permit SemVer pre-release publication. | |
76e5ac6f | 147 | |
e4796ecd JB |
148 | ## [2.3.10-2] - 2023-03-18 |
149 | ||
6abad580 JB |
150 | ### Fixed |
151 | ||
152 | - Fix `exports` syntax for ESM and CommonJS. | |
153 | ||
a2ee98cc JB |
154 | ## [2.3.10-1] - 2023-03-18 |
155 | ||
7e060cee JB |
156 | ### Changed |
157 | ||
90483887 | 158 | - Permit SemVer pre-release publication. |
7e060cee | 159 | |
c81bfafb JB |
160 | ## [2.3.10-0] - 2023-03-18 |
161 | ||
fe18768d JB |
162 | ### Fixed |
163 | ||
164 | - Fix `exports` syntax for ESM and CommonJS. | |
165 | ||
d7b78217 JB |
166 | ## [2.3.9] - 2023-03-18 |
167 | ||
ed6dd37f JB |
168 | ### Changed |
169 | ||
170 | - Introduce ESM module support along with CommonJS one. | |
171 | ||
172 | ### Fixed | |
173 | ||
174 | - Fix brown paper bag bug referencing the same object literal. | |
175 | ||
68e2ad86 JB |
176 | ## [2.3.8] - 2023-03-18 |
177 | ||
ca6c7d70 JB |
178 | ### Changed |
179 | ||
180 | - Switch internal benchmarking code to benny. | |
fbdedeb9 JB |
181 | - Switch to TypeScript 5.x.x. |
182 | - Switch rollup bundler plugins to core ones. | |
ed6dd37f | 183 | - Switch to TSDoc syntax. |
fbdedeb9 | 184 | - Enforce conventional commits. |
ca6c7d70 | 185 | |
d15211d4 JB |
186 | ### Fixed |
187 | ||
188 | - Fix random integer generator. | |
fbdedeb9 | 189 | - Fix worker choice strategy pool type identification at initialization. |
d15211d4 | 190 | |
995705ea JB |
191 | ## [2.3.7] - 2022-10-23 |
192 | ||
b953022b JB |
193 | ### Changed |
194 | ||
195 | - Switch to open collective FOSS project funding platform. | |
78cea37e JB |
196 | - Switch to ts-standard linter configuration on TypeScript code. |
197 | ||
198 | ### Fixed | |
199 | ||
200 | - Fixed missing async on pool execute method. | |
201 | - Fixed typing in TypeScript example. | |
202 | - Fixed types in unit tests. | |
b953022b | 203 | |
3b9f6953 JB |
204 | ## [2.3.6] - 2022-10-22 |
205 | ||
f80cead4 JB |
206 | ### Changed |
207 | ||
208 | - Cleanup pool attributes and methods. | |
209 | - Refine error types thrown. | |
210 | ||
211 | ### Fixed | |
212 | ||
213 | - Fix continuous integration build on windows. | |
214 | - Fix code coverage reporting by using c8 instead of nyc. | |
215 | ||
efc22107 JB |
216 | ## [2.3.5] - 2022-10-21 |
217 | ||
7a6a0a96 JB |
218 | ### Changed |
219 | ||
a05c10de JB |
220 | - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter. |
221 | - Optimize tasks usage lookup implementation. | |
7a6a0a96 | 222 | |
b4904890 JB |
223 | ### Fixed |
224 | ||
225 | - Fix missed pool event emitter type export. | |
226 | - Fix typedoc documentation generation. | |
227 | ||
a875f8d1 JB |
228 | ## [2.3.4] - 2022-10-17 |
229 | ||
73cda448 JB |
230 | ### Added |
231 | ||
232 | - Fully automate release process with release-it. | |
233 | ||
45a5a54c JB |
234 | ### Changed |
235 | ||
73cda448 | 236 | - Optimize fair share task scheduling algorithm implementation. |
eb4a8a82 | 237 | - Update benchmarks versus external pools results with latest version. |
45a5a54c | 238 | |
90ee1b18 | 239 | ## [2.3.3] - 2022-10-15 |
1a76932b JB |
240 | |
241 | ### Added | |
242 | ||
243 | - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options. | |
244 | ||
90ee1b18 | 245 | ## [2.3.2] - 2022-10-14 |
11df3590 JB |
246 | |
247 | ### Changed | |
248 | ||
249 | - Optimize fair share worker selection strategy implementation. | |
250 | ||
251 | ### Fixed | |
252 | ||
253 | - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled. | |
254 | ||
90ee1b18 | 255 | ## [2.3.1] - 2022-10-13 |
23ff945a JB |
256 | |
257 | ### Added | |
258 | ||
259 | - Pool worker choice strategies: | |
260 | - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now. | |
261 | - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now. | |
262 | ||
90ee1b18 | 263 | ## [2.2.2] - 2022-10-09 |
cb2b6c69 JB |
264 | |
265 | ### Fixed | |
266 | ||
267 | - Fixed `README.md` file. | |
268 | ||
90ee1b18 | 269 | ## [2.2.1] - 2022-10-08 |
bdacc2d2 | 270 | |
bdaf31cd JB |
271 | ### Added |
272 | ||
273 | - Dynamic worker choice strategy change at runtime. | |
bdacc2d2 | 274 | |
90ee1b18 | 275 | ## [2.2.0] - 2022-01-05 |
7e0d447f JB |
276 | |
277 | ### Breaking Changes | |
278 | ||
279 | - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version. | |
280 | ||
90ee1b18 | 281 | ## [2.1.0] - 2021-08-29 |
35cf1c03 JB |
282 | |
283 | ### Added | |
284 | ||
285 | - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker. | |
e088a00c JB |
286 | |
287 | ### Breaking Changes | |
288 | ||
289 | - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute. | |
290 | - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`. | |
291 | - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`. | |
c365b2d3 | 292 | - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker. |
e088a00c | 293 | |
90ee1b18 | 294 | ## [2.0.2] - 2021-05-12 |
14916bf9 JB |
295 | |
296 | ### Bug fixes | |
297 | ||
298 | - Fix `busy` event emission on fixed pool type | |
299 | ||
90ee1b18 | 300 | ## [2.0.1] - 2021-03-16 |
7f685093 JB |
301 | |
302 | ### Bug fixes | |
303 | ||
304 | - Check if pool options are properly set. | |
305 | - `busy` event is emitted on all pool types. | |
306 | ||
90ee1b18 | 307 | ## [2.0.0] - 2021-03-01 |
fa0f5b28 | 308 | |
f3f833ab | 309 | ### Bug fixes |
d63d3be3 | 310 | |
ddbeaffd | 311 | - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70). |
d63d3be3 | 312 | |
fa0f5b28 S |
313 | ### Breaking Changes |
314 | ||
7f685093 | 315 | - `FullPool` event is now renamed to `busy`. |
1927ee67 | 316 | - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`. |
1a81f8af | 317 | _Find more details on our JSDoc._ |
ddbeaffd | 318 | |
1927ee67 APA |
319 | - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed. |
320 | ||
ddbeaffd | 321 | - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes. |
fa0f5b28 | 322 | |
ec2ccfc8 JB |
323 | ### Pool options types declaration merge |
324 | ||
325 | `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`. | |
326 | ||
fa0f5b28 S |
327 | #### New `export` strategy |
328 | ||
329 | ```js | |
330 | // Before | |
777b7824 | 331 | const DynamicThreadPool = require('poolifier/lib/dynamic') |
fa0f5b28 | 332 | // After |
777b7824 | 333 | const { DynamicThreadPool } = require('poolifier/lib/dynamic') |
fa0f5b28 S |
334 | ``` |
335 | ||
336 | But you should always prefer just using | |
337 | ||
338 | ```js | |
777b7824 | 339 | const { DynamicThreadPool } = require('poolifier') |
fa0f5b28 S |
340 | ``` |
341 | ||
d3c8a1a8 S |
342 | #### New type definitions for input data and response |
343 | ||
ec2ccfc8 | 344 | For cluster worker and worker-thread pools, you can now only send and receive serializable data. |
d3c8a1a8 S |
345 | _This is not a limitation by poolifier but NodeJS._ |
346 | ||
3a4b605f | 347 | #### Public property replacements |
5c5a1fb7 | 348 | |
3a4b605f | 349 | `numWorkers` property is now `numberOfWorkers` |
5c5a1fb7 | 350 | |
280c2a77 | 351 | #### Internal (protected) properties and methods renaming |
fa0f5b28 | 352 | |
280c2a77 S |
353 | These properties are not intended for end users |
354 | ||
355 | - `id` => `nextMessageId` | |
356 | ||
357 | These methods are not intended for end users | |
fa0f5b28 S |
358 | |
359 | - `_chooseWorker` => `chooseWorker` | |
280c2a77 | 360 | - `_newWorker` => `createWorker` |
fa0f5b28 S |
361 | - `_execute` => `internalExecute` |
362 | - `_chooseWorker` => `chooseWorker` | |
363 | - `_checkAlive` => `checkAlive` | |
364 | - `_run` => `run` | |
365 | - `_runAsync` => `runAsync` | |
366 | ||
90ee1b18 | 367 | ## [1.1.0] - 2020-05-21 |
0312f71a APA |
368 | |
369 | ### Added | |
370 | ||
371 | - ThreadWorker support async functions as option | |
cf9aa6c3 | 372 | - Various external library patches |
0312f71a | 373 | |
90ee1b18 | 374 | ## [1.0.0] - 2020-01-24 |
522eea03 | 375 | |
376 | ### Added | |
377 | ||
378 | - FixedThreadPool implementation | |
379 | - DynamicThreadPool implementation | |
0312f71a | 380 | - WorkerThread implementation to improve developer experience |