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