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