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