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 | ||
8660b972 JB |
10 | ### Changed |
11 | ||
12 | - Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller. | |
13 | ||
206a3519 JB |
14 | ## [2.6.17] - 2023-07-16 |
15 | ||
b4899fae JB |
16 | ### Added |
17 | ||
b569873d | 18 | - Add `listTaskFunctions()` method to worker class. |
b4899fae | 19 | |
58a06a6c JB |
20 | ## [2.6.16] - 2023-07-12 |
21 | ||
2a69b8c5 JB |
22 | ### Fixed |
23 | ||
80520ca4 | 24 | - Fix pool startup detection. |
2a69b8c5 JB |
25 | - Fix worker task functions handling. |
26 | ||
b5900b02 JB |
27 | ## [2.6.15] - 2023-07-11 |
28 | ||
19dbc45b JB |
29 | ### Added |
30 | ||
31 | - Take into account worker node readiness in worker choice strategies. | |
32 | ||
4a0db581 JB |
33 | ## [2.6.14] - 2023-07-10 |
34 | ||
87e44747 JB |
35 | ### Fixed |
36 | ||
37 | - Fix task function statistics tracking. | |
38 | ||
0265272f JB |
39 | ## [2.6.13] - 2023-07-10 |
40 | ||
968a2e8c JB |
41 | ### Added |
42 | ||
43 | - Add per task function statistics tracking. | |
782299f8 | 44 | - Add public methods to manipulate the worker task functions at runtime. |
968a2e8c | 45 | |
44c8c00f JB |
46 | ## [2.6.12] - 2023-07-09 |
47 | ||
aa4bf4b2 JB |
48 | ### Fixed |
49 | ||
50 | - Workaround import issue with `node:os` module in node 16.x.x. | |
51 | ||
b7cfced1 JB |
52 | ## [2.6.11] - 2023-07-09 |
53 | ||
d5024c00 JB |
54 | ### Fixed |
55 | ||
56 | - Fix pool readiness semantic. | |
57 | ||
f313a208 JB |
58 | ## [2.6.10] - 2023-07-08 |
59 | ||
2431bdb4 JB |
60 | ### Fixed |
61 | ||
62 | - Ensure workers are not recreated on error at pool startup. | |
63 | ||
64 | ### Added | |
65 | ||
66 | - Add `ready` and `strategy` fields to pool information. | |
67 | - Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready. | |
caadbd41 | 68 | - Add dynamic pool sizing checks. |
2431bdb4 | 69 | |
369d0a51 JB |
70 | ## [2.6.9] - 2023-07-07 |
71 | ||
2845f2a5 JB |
72 | ### Fixed |
73 | ||
74 | - Recreate the right worker type on uncaught exception. | |
75 | ||
76 | ### Added | |
77 | ||
78 | - Add minimum and maximum to internal measurement statistics. | |
1dcf8b7b | 79 | - Add `runTime` and `waitTime` to pool information. |
75d3401a | 80 | - Check worker inactive time only on dynamic worker. |
2845f2a5 | 81 | |
fc97d613 JB |
82 | ## [2.6.8] - 2023-07-03 |
83 | ||
92b1feaa JB |
84 | ### Fixed |
85 | ||
86 | - Brown paper bag release to fix version handling in pool information. | |
87 | ||
52d54060 JB |
88 | ## [2.6.7] - 2023-07-03 |
89 | ||
5bc91f3e JB |
90 | ### Fixed |
91 | ||
92 | - Ensure worker queued tasks at error are reassigned to other pool workers. | |
93 | ||
afe0d5bf JB |
94 | ### Added |
95 | ||
96 | - Add pool `utilization` ratio to pool information. | |
23ccf9d7 | 97 | - Add `version` to pool information. |
e5b3047d | 98 | - Add worker information to worker nodes. |
afe0d5bf | 99 | |
f42c583f JB |
100 | ## [2.6.6] - 2023-07-01 |
101 | ||
6961ca9a JB |
102 | ### Added |
103 | ||
104 | - Add safe helper `availableParallelism` to help sizing the pool. | |
105 | ||
3749facb JB |
106 | ### Fixed |
107 | ||
108 | - Ensure message handler is only registered in worker. | |
109 | ||
6fed2513 JB |
110 | ## [2.6.5] - 2023-06-27 |
111 | ||
c72f6987 JB |
112 | ### Known issues |
113 | ||
70726c28 | 114 | - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782 |
c72f6987 JB |
115 | |
116 | ### Fixed | |
117 | ||
118 | - Artificial version bump to 2.6.5 to workaround publication issue. | |
119 | - Ensure cluster pool destroy() gracefully shutdowns worker's server. | |
120 | - Ensure pool event is emitted before task error promise rejection. | |
121 | - Fix queued tasks count computation. | |
122 | ||
123 | ### Removed | |
124 | ||
2fbe1783 | 125 | - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC. |
c72f6987 | 126 | |
6426631b JB |
127 | ## [2.6.4] - 2023-06-27 |
128 | ||
941f9a7c JB |
129 | ### Known issues |
130 | ||
70726c28 | 131 | - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782 |
941f9a7c | 132 | |
2c039e43 JB |
133 | ### Fixed |
134 | ||
135 | - Ensure cluster pool destroy() gracefully shutdowns worker's server. | |
136 | - Ensure pool event is emitted before task error promise rejection. | |
9c16fb4b | 137 | - Fix queued tasks count computation. |
2c039e43 | 138 | |
941f9a7c JB |
139 | ### Removed |
140 | ||
2fbe1783 | 141 | - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC. |
941f9a7c | 142 | |
bc1b0765 JB |
143 | ## [2.6.3] - 2023-06-19 |
144 | ||
a6a2dc4c JB |
145 | ### Fixed |
146 | ||
147 | - Ensure no tasks are queued when trying to soft kill a dynamic worker. | |
f0d7f803 | 148 | - Update strategies internals after statistics computation. |
a6a2dc4c | 149 | |
7b56f532 JB |
150 | ### Changed |
151 | ||
152 | - Optimize O(1) queue implementation. | |
153 | ||
b628596c JB |
154 | ## [2.6.2] - 2023-06-12 |
155 | ||
a9e89d00 JB |
156 | ### Fixed |
157 | ||
158 | - Fix new worker use after creation in dynamic pool given the current worker choice strategy. | |
159 | ||
4368a898 JB |
160 | ## [2.6.1] - 2023-06-10 |
161 | ||
931d43e2 JB |
162 | ### Added |
163 | ||
164 | - Add worker choice strategy documentation: [README.md](./src/pools/selection-strategies/README.md). | |
165 | ||
f1c06930 JB |
166 | ### Fixed |
167 | ||
168 | - Fix average statistics computation: ensure failed tasks are not accounted. | |
169 | ||
16671b07 JB |
170 | ## [2.6.0] - 2023-06-09 |
171 | ||
a1347286 JB |
172 | ### Added |
173 | ||
5af9c0f7 | 174 | - Add `LEAST_ELU` worker choice strategy (experimental). |
9adcefab | 175 | - Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy. |
a1347286 | 176 | |
1c6fe997 JB |
177 | ### Changed |
178 | ||
179 | - Refactor pool worker node usage internals. | |
477f48e7 | 180 | - Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed. |
f63a9dda | 181 | - Breaking change: pool information `info` property object fields have been renamed. |
1c6fe997 JB |
182 | |
183 | ### Fixed | |
184 | ||
185 | - Fix wait time accounting. | |
186 | - Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time. | |
187 | - Ensure worker choice strategy `LEAST_USED` accounts also queued tasks. | |
188 | ||
aa07d6ee JB |
189 | ## [2.5.4] - 2023-06-07 |
190 | ||
b6b32453 JB |
191 | ### Added |
192 | ||
193 | - Add Event Loop Utilization (ELU) statistics to worker tasks usage. | |
194 | ||
195 | ### Changed | |
196 | ||
197 | - Compute statistics at the worker level only if needed. | |
2fbe1783 | 198 | - Add `worker_threads` options to thread pool options. |
b6b32453 | 199 | |
272d4d8f JB |
200 | ### Fixed |
201 | ||
202 | - Make the `LEAST_BUSY` strategy only relies on task runtime. | |
203 | ||
ed47fb3d JB |
204 | ## [2.5.3] - 2023-06-04 |
205 | ||
89a4abfd JB |
206 | ### Changed |
207 | ||
208 | - Refine pool information content. | |
b4213b7f | 209 | - Limit pool internals public exposure. |
89a4abfd | 210 | |
8a9febf5 JB |
211 | ## [2.5.2] - 2023-06-02 |
212 | ||
91ee39ed JB |
213 | ### Added |
214 | ||
215 | - Add `taskError` pool event for task execution error. | |
6b27d407 | 216 | - Add pool information `info` property to pool. |
91ee39ed JB |
217 | - Emit pool information on `busy` and `full` pool events. |
218 | ||
8babb151 JB |
219 | ## [2.5.1] - 2023-06-01 |
220 | ||
0e05c4dc JB |
221 | ### Added |
222 | ||
1f68cede | 223 | - Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`. |
91ee39ed | 224 | - Add `error` pool event for uncaught worker error. |
0e05c4dc | 225 | |
a8766181 JB |
226 | ## [2.5.0] - 2023-05-31 |
227 | ||
e4543b14 JB |
228 | ### Added |
229 | ||
230 | - Switch pool event emitter to `EventEmitterAsyncResource`. | |
6da80d38 | 231 | - Add tasks wait time accounting in per worker tasks usage. |
5af9c0f7 | 232 | - Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental). |
e4543b14 JB |
233 | |
234 | ### Changed | |
235 | ||
236 | - Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`. | |
237 | ||
570efb11 JB |
238 | ## [2.4.14] - 2023-05-09 |
239 | ||
b0f28bad JB |
240 | ### Fixed |
241 | ||
242 | - Ensure no undefined task runtime can land in the tasks history. | |
243 | - Fix median computation implementation once again. | |
244 | ||
110b6d13 JB |
245 | ### Added |
246 | ||
247 | - Unit tests for median and queue implementations. | |
248 | ||
72584880 JB |
249 | ## [2.4.13] - 2023-05-08 |
250 | ||
b0d6ed8f JB |
251 | ### Fixed |
252 | ||
e3058615 | 253 | - Fix worker choice strategy options validation. |
b0d6ed8f JB |
254 | - Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission. |
255 | ||
06140c32 JB |
256 | ## [2.4.12] - 2023-05-06 |
257 | ||
a86b6df1 JB |
258 | ### Added |
259 | ||
260 | - Support multiple task functions per worker. | |
08f3f44c | 261 | - Add custom worker weights support to worker choice strategies options. |
a86b6df1 | 262 | |
29ee7e9a JB |
263 | ### Changed |
264 | ||
265 | - Use O(1) queue implementation for tasks queueing. | |
266 | ||
0682ba15 JB |
267 | ### Fixed |
268 | ||
269 | - Fix median computation implementation. | |
270 | - Fix fair share worker choice strategy internals update. | |
271 | ||
936d53ec JB |
272 | ## [2.4.11] - 2023-04-23 |
273 | ||
cb70b19d JB |
274 | ### Changed |
275 | ||
276 | - Optimize free worker finding in worker choice strategies. | |
277 | ||
15bb637a JB |
278 | ## [2.4.10] - 2023-04-15 |
279 | ||
ef41a6e6 JB |
280 | ### Fixed |
281 | ||
282 | - Fix typescript type definition for worker function: ensure the input data is optional. | |
283 | - Fix typescript type definition for pool execute(): ensure the input data is optional. | |
284 | ||
181eb2b4 JB |
285 | ## [2.4.9] - 2023-04-15 |
286 | ||
a20f0ba5 JB |
287 | ### Added |
288 | ||
289 | - Add tasks queue enablement runtime setter to pool. | |
290 | - Add tasks queue options runtime setter to pool. | |
291 | - Add worker choice strategy options runtime setter to pool. | |
292 | ||
293 | ### Changed | |
294 | ||
295 | - Remove the tasks queuing experimental status. | |
296 | ||
d4aeae5a JB |
297 | ### Fixed |
298 | ||
299 | - Fix worker function type definition and validation. | |
2fc5cae3 | 300 | - Fix worker choice strategy options handling. |
d4aeae5a | 301 | |
1d9e7023 JB |
302 | ## [2.4.8] - 2023-04-12 |
303 | ||
f9b4bbf8 JB |
304 | ### Fixed |
305 | ||
306 | - Fix message between main worker and worker type definition for tasks. | |
307 | - Fix code documentation. | |
308 | ||
12ae3210 JB |
309 | ## [2.4.7] - 2023-04-11 |
310 | ||
7171d33f JB |
311 | ### Added |
312 | ||
313 | - Add worker tasks queue options to pool options. | |
314 | ||
e8bd29ce JB |
315 | ### Fixed |
316 | ||
317 | - Fix missing documentation. | |
318 | ||
42c7bc10 JB |
319 | ## [2.4.6] - 2023-04-10 |
320 | ||
681196cc JB |
321 | ### Fixed |
322 | ||
323 | - Ensure one task at a time is executed per worker with tasks queueing enabled. | |
1c6fe997 | 324 | - Properly count worker executing tasks with tasks queueing enabled. |
681196cc | 325 | |
54d360e3 JB |
326 | ## [2.4.5] - 2023-04-09 |
327 | ||
3fafb1b2 JB |
328 | ### Added |
329 | ||
9e775f96 JB |
330 | - Use monotonic high resolution timer for worker tasks runtime. |
331 | - Add worker tasks median runtime to statistics. | |
ff733df7 | 332 | - Add worker tasks queue (experimental). |
3fafb1b2 | 333 | |
92fa3eb6 JB |
334 | ## [2.4.4] - 2023-04-07 |
335 | ||
aee46736 JB |
336 | ### Added |
337 | ||
338 | - Add `PoolEvents` enumeration and `PoolEvent` type. | |
339 | ||
36b5e78f JB |
340 | ### Fixed |
341 | ||
ff0c2b3e | 342 | - Destroy worker only on alive check. |
36b5e78f | 343 | |
9fb0f324 JB |
344 | ## [2.4.3] - 2023-04-07 |
345 | ||
28cf3617 JB |
346 | ### Fixed |
347 | ||
348 | - Fix typedoc generation with inheritance. | |
349 | ||
848f0f27 JB |
350 | ## [2.4.2] - 2023-04-06 |
351 | ||
164d950a JB |
352 | ### Added |
353 | ||
354 | - Add `full` event to dynamic pool. | |
32417142 | 355 | - Keep worker choice strategy in memory for conditional reuse. |
164d950a | 356 | |
78ab2555 JB |
357 | ### Fixed |
358 | ||
359 | - Fix possible negative worker key at worker removal in worker choice strategies. | |
360 | ||
79aafe9f JB |
361 | ## [2.4.1] - 2023-04-05 |
362 | ||
9cd39dd4 JB |
363 | ### Changed |
364 | ||
365 | - Optimize worker choice strategy for dynamic pool. | |
366 | ||
965415bb JB |
367 | ### Fixed |
368 | ||
369 | - Ensure dynamic pool does not alter worker choice strategy expected behavior. | |
370 | ||
d8b60b1c JB |
371 | ## [2.4.0] - 2023-04-04 |
372 | ||
c6bd2650 JB |
373 | ### Added |
374 | ||
375 | - Add `LESS_BUSY` worker choice strategy. | |
376 | ||
377 | ### Changed | |
378 | ||
379 | - Optimize worker storage in pool. | |
380 | - Optimize worker alive status check. | |
381 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
382 | - Optimize `LESS_USED` worker choice strategy. | |
383 | - Update benchmarks versus external threads pools. | |
384 | - Optimize tasks usage statistics requirements for worker choice strategy. | |
385 | ||
386 | ### Fixed | |
387 | ||
388 | - Ensure trimmable characters are checked at pool initialization. | |
389 | - Fix message id integer overflow. | |
390 | - Fix pool worker removal in worker choice strategy internals. | |
391 | - Fix package publication with pnpm. | |
392 | ||
d0a3f018 JB |
393 | ## [2.4.0-3] - 2023-04-04 |
394 | ||
b2ede285 JB |
395 | ### Added |
396 | ||
397 | - Add `LESS_BUSY` worker choice strategy. | |
398 | ||
399 | ### Changed | |
400 | ||
401 | - Optimize worker storage in pool. | |
402 | - Optimize worker alive status check. | |
403 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
404 | - Optimize `LESS_USED` worker choice strategy. | |
405 | - Update benchmarks versus external threads pools. | |
406 | ||
407 | ### Fixed | |
408 | ||
409 | - Ensure trimmable characters are checked at pool initialization. | |
410 | - Fix message id integer overflow. | |
411 | - Fix pool worker removal in worker choice strategy internals. | |
412 | - Fix package publication with pnpm. | |
413 | ||
a015ea40 JB |
414 | ## [2.4.0-2] - 2023-04-03 |
415 | ||
698f4bbc JB |
416 | ### Added |
417 | ||
418 | - Add `LESS_BUSY` worker choice strategy. | |
419 | ||
420 | ### Changed | |
421 | ||
422 | - Optimize worker storage in pool. | |
423 | - Optimize worker alive status check. | |
424 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
425 | - Optimize `LESS_USED` worker choice strategy. | |
426 | ||
427 | ### Fixed | |
428 | ||
429 | - Ensure trimmable characters are checked at pool initialization. | |
430 | - Fix message id integer overflow. | |
431 | - Fix pool worker removal in worker choice strategy internals. | |
432 | - Fix package publication with pnpm. | |
433 | ||
8fe15920 JB |
434 | ## [2.4.0-1] - 2023-04-03 |
435 | ||
5b301c28 JB |
436 | ### Added |
437 | ||
438 | - Add `LESS_BUSY` worker choice strategy. | |
439 | ||
440 | ### Changed | |
441 | ||
442 | - Optimize worker storage in pool. | |
443 | - Optimize worker alive status check. | |
444 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
445 | - Optimize `LESS_USED` worker choice strategy. | |
446 | ||
447 | ### Fixed | |
448 | ||
449 | - Ensure trimmable characters are checked at pool initialization. | |
450 | - Fix message id integer overflow. | |
451 | - Fix pool worker removal in worker choice strategy internals. | |
452 | ||
2fb9ca9c JB |
453 | ## [2.4.0-0] - 2023-04-03 |
454 | ||
168c526f JB |
455 | ### Added |
456 | ||
457 | - Add `LESS_BUSY` worker choice strategy. | |
458 | ||
1d71a908 JB |
459 | ### Changed |
460 | ||
ffcbbad8 | 461 | - Optimize worker storage in pool. |
1d71a908 | 462 | - Optimize worker alive status check. |
65a60b3b | 463 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. |
737c6d97 | 464 | - Optimize `LESS_USED` worker choice strategy. |
1d71a908 | 465 | |
ffcbbad8 JB |
466 | ### Fixed |
467 | ||
468 | - Ensure trimmable characters are checked at pool initialization. | |
b4e75778 | 469 | - Fix message id integer overflow. |
97a2abc3 | 470 | - Fix pool worker removal in worker choice strategy internals. |
ffcbbad8 | 471 | |
08372738 JB |
472 | ## [2.3.10] - 2023-03-18 |
473 | ||
710826bc JB |
474 | ### Fixed |
475 | ||
476 | - Fix `exports` syntax for ESM and CommonJS. | |
477 | ||
478 | ### Changed | |
479 | ||
480 | - Permit SemVer pre-release publication. | |
76e5ac6f | 481 | |
e4796ecd JB |
482 | ## [2.3.10-2] - 2023-03-18 |
483 | ||
6abad580 JB |
484 | ### Fixed |
485 | ||
486 | - Fix `exports` syntax for ESM and CommonJS. | |
487 | ||
a2ee98cc JB |
488 | ## [2.3.10-1] - 2023-03-18 |
489 | ||
7e060cee JB |
490 | ### Changed |
491 | ||
90483887 | 492 | - Permit SemVer pre-release publication. |
7e060cee | 493 | |
c81bfafb JB |
494 | ## [2.3.10-0] - 2023-03-18 |
495 | ||
fe18768d JB |
496 | ### Fixed |
497 | ||
498 | - Fix `exports` syntax for ESM and CommonJS. | |
499 | ||
d7b78217 JB |
500 | ## [2.3.9] - 2023-03-18 |
501 | ||
ed6dd37f JB |
502 | ### Changed |
503 | ||
504 | - Introduce ESM module support along with CommonJS one. | |
505 | ||
506 | ### Fixed | |
507 | ||
508 | - Fix brown paper bag bug referencing the same object literal. | |
509 | ||
68e2ad86 JB |
510 | ## [2.3.8] - 2023-03-18 |
511 | ||
ca6c7d70 JB |
512 | ### Changed |
513 | ||
514 | - Switch internal benchmarking code to benny. | |
fbdedeb9 JB |
515 | - Switch to TypeScript 5.x.x. |
516 | - Switch rollup bundler plugins to core ones. | |
ed6dd37f | 517 | - Switch to TSDoc syntax. |
fbdedeb9 | 518 | - Enforce conventional commits. |
ca6c7d70 | 519 | |
d15211d4 JB |
520 | ### Fixed |
521 | ||
522 | - Fix random integer generator. | |
fbdedeb9 | 523 | - Fix worker choice strategy pool type identification at initialization. |
d15211d4 | 524 | |
995705ea JB |
525 | ## [2.3.7] - 2022-10-23 |
526 | ||
b953022b JB |
527 | ### Changed |
528 | ||
529 | - Switch to open collective FOSS project funding platform. | |
78cea37e JB |
530 | - Switch to ts-standard linter configuration on TypeScript code. |
531 | ||
532 | ### Fixed | |
533 | ||
534 | - Fixed missing async on pool execute method. | |
535 | - Fixed typing in TypeScript example. | |
536 | - Fixed types in unit tests. | |
b953022b | 537 | |
3b9f6953 JB |
538 | ## [2.3.6] - 2022-10-22 |
539 | ||
f80cead4 JB |
540 | ### Changed |
541 | ||
542 | - Cleanup pool attributes and methods. | |
543 | - Refine error types thrown. | |
544 | ||
545 | ### Fixed | |
546 | ||
547 | - Fix continuous integration build on windows. | |
548 | - Fix code coverage reporting by using c8 instead of nyc. | |
549 | ||
efc22107 JB |
550 | ## [2.3.5] - 2022-10-21 |
551 | ||
7a6a0a96 JB |
552 | ### Changed |
553 | ||
a05c10de JB |
554 | - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter. |
555 | - Optimize tasks usage lookup implementation. | |
7a6a0a96 | 556 | |
b4904890 JB |
557 | ### Fixed |
558 | ||
559 | - Fix missed pool event emitter type export. | |
560 | - Fix typedoc documentation generation. | |
561 | ||
a875f8d1 JB |
562 | ## [2.3.4] - 2022-10-17 |
563 | ||
73cda448 JB |
564 | ### Added |
565 | ||
566 | - Fully automate release process with release-it. | |
567 | ||
45a5a54c JB |
568 | ### Changed |
569 | ||
73cda448 | 570 | - Optimize fair share task scheduling algorithm implementation. |
eb4a8a82 | 571 | - Update benchmarks versus external pools results with latest version. |
45a5a54c | 572 | |
90ee1b18 | 573 | ## [2.3.3] - 2022-10-15 |
1a76932b JB |
574 | |
575 | ### Added | |
576 | ||
577 | - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options. | |
578 | ||
90ee1b18 | 579 | ## [2.3.2] - 2022-10-14 |
11df3590 JB |
580 | |
581 | ### Changed | |
582 | ||
583 | - Optimize fair share worker selection strategy implementation. | |
584 | ||
585 | ### Fixed | |
586 | ||
587 | - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled. | |
588 | ||
90ee1b18 | 589 | ## [2.3.1] - 2022-10-13 |
23ff945a JB |
590 | |
591 | ### Added | |
592 | ||
593 | - Pool worker choice strategies: | |
594 | - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now. | |
595 | - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now. | |
596 | ||
90ee1b18 | 597 | ## [2.2.2] - 2022-10-09 |
cb2b6c69 JB |
598 | |
599 | ### Fixed | |
600 | ||
601 | - Fixed `README.md` file. | |
602 | ||
90ee1b18 | 603 | ## [2.2.1] - 2022-10-08 |
bdacc2d2 | 604 | |
bdaf31cd JB |
605 | ### Added |
606 | ||
607 | - Dynamic worker choice strategy change at runtime. | |
bdacc2d2 | 608 | |
90ee1b18 | 609 | ## [2.2.0] - 2022-01-05 |
7e0d447f JB |
610 | |
611 | ### Breaking Changes | |
612 | ||
613 | - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version. | |
614 | ||
90ee1b18 | 615 | ## [2.1.0] - 2021-08-29 |
35cf1c03 JB |
616 | |
617 | ### Added | |
618 | ||
619 | - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker. | |
e088a00c JB |
620 | |
621 | ### Breaking Changes | |
622 | ||
623 | - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute. | |
624 | - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`. | |
625 | - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`. | |
c365b2d3 | 626 | - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker. |
e088a00c | 627 | |
90ee1b18 | 628 | ## [2.0.2] - 2021-05-12 |
14916bf9 JB |
629 | |
630 | ### Bug fixes | |
631 | ||
632 | - Fix `busy` event emission on fixed pool type | |
633 | ||
90ee1b18 | 634 | ## [2.0.1] - 2021-03-16 |
7f685093 JB |
635 | |
636 | ### Bug fixes | |
637 | ||
638 | - Check if pool options are properly set. | |
639 | - `busy` event is emitted on all pool types. | |
640 | ||
90ee1b18 | 641 | ## [2.0.0] - 2021-03-01 |
fa0f5b28 | 642 | |
f3f833ab | 643 | ### Bug fixes |
d63d3be3 | 644 | |
ddbeaffd | 645 | - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70). |
d63d3be3 | 646 | |
fa0f5b28 S |
647 | ### Breaking Changes |
648 | ||
7f685093 | 649 | - `FullPool` event is now renamed to `busy`. |
1927ee67 | 650 | - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`. |
1a81f8af | 651 | _Find more details on our JSDoc._ |
ddbeaffd | 652 | |
1927ee67 APA |
653 | - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed. |
654 | ||
ddbeaffd | 655 | - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes. |
fa0f5b28 | 656 | |
ec2ccfc8 JB |
657 | ### Pool options types declaration merge |
658 | ||
659 | `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`. | |
660 | ||
fa0f5b28 S |
661 | #### New `export` strategy |
662 | ||
663 | ```js | |
664 | // Before | |
777b7824 | 665 | const DynamicThreadPool = require('poolifier/lib/dynamic') |
fa0f5b28 | 666 | // After |
777b7824 | 667 | const { DynamicThreadPool } = require('poolifier/lib/dynamic') |
fa0f5b28 S |
668 | ``` |
669 | ||
670 | But you should always prefer just using | |
671 | ||
672 | ```js | |
777b7824 | 673 | const { DynamicThreadPool } = require('poolifier') |
fa0f5b28 S |
674 | ``` |
675 | ||
d3c8a1a8 S |
676 | #### New type definitions for input data and response |
677 | ||
6677a3d3 | 678 | For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data. |
d3c8a1a8 S |
679 | _This is not a limitation by poolifier but NodeJS._ |
680 | ||
3a4b605f | 681 | #### Public property replacements |
5c5a1fb7 | 682 | |
3a4b605f | 683 | `numWorkers` property is now `numberOfWorkers` |
5c5a1fb7 | 684 | |
280c2a77 | 685 | #### Internal (protected) properties and methods renaming |
fa0f5b28 | 686 | |
280c2a77 S |
687 | These properties are not intended for end users |
688 | ||
689 | - `id` => `nextMessageId` | |
690 | ||
691 | These methods are not intended for end users | |
fa0f5b28 S |
692 | |
693 | - `_chooseWorker` => `chooseWorker` | |
280c2a77 | 694 | - `_newWorker` => `createWorker` |
fa0f5b28 S |
695 | - `_execute` => `internalExecute` |
696 | - `_chooseWorker` => `chooseWorker` | |
697 | - `_checkAlive` => `checkAlive` | |
698 | - `_run` => `run` | |
699 | - `_runAsync` => `runAsync` | |
700 | ||
90ee1b18 | 701 | ## [1.1.0] - 2020-05-21 |
0312f71a APA |
702 | |
703 | ### Added | |
704 | ||
705 | - ThreadWorker support async functions as option | |
cf9aa6c3 | 706 | - Various external library patches |
0312f71a | 707 | |
90ee1b18 | 708 | ## [1.0.0] - 2020-01-24 |
522eea03 | 709 | |
710 | ### Added | |
711 | ||
712 | - FixedThreadPool implementation | |
713 | - DynamicThreadPool implementation | |
0312f71a | 714 | - WorkerThread implementation to improve developer experience |