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