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 | 8 | ## [Unreleased] |
9aa78bcb | 9 | |
41328ae5 JB |
10 | ### Fixed |
11 | ||
12 | - Fix publishing on JSR, take 2. | |
13 | ||
8fddc9ad JB |
14 | ## [3.1.24] - 2024-03-27 |
15 | ||
fcc6278e JB |
16 | ### Fixed |
17 | ||
18 | - Fix publishing on JSR. | |
19 | ||
7586f5a8 JB |
20 | ## [3.1.23] - 2024-03-27 |
21 | ||
b7bb8586 JB |
22 | ### Changed |
23 | ||
24 | - Publish on JSR. | |
25 | ||
01f4a5ce JB |
26 | ## [3.1.22] - 2024-03-15 |
27 | ||
d67bed32 JB |
28 | ### Fixed |
29 | ||
30 | - Fix pool event emitter registered callbacks removal at `destroy()`. | |
31 | ||
6fd820e6 JB |
32 | ## [3.1.21] - 2024-02-22 |
33 | ||
369179f6 JB |
34 | ### Fixed |
35 | ||
36 | - Fix null exception regression: [#1496](https://github.com/poolifier/poolifier/issues/1496). | |
37 | ||
c96e6364 JB |
38 | ## [3.1.20] - 2024-02-11 |
39 | ||
d20cde84 JB |
40 | ### Fixed |
41 | ||
42 | - Ensure `worker_threads` workers are unreferenced at termination. | |
43 | ||
a7358578 JB |
44 | ## [3.1.19] - 2024-01-16 |
45 | ||
16d7e943 JB |
46 | ### Fixed |
47 | ||
48 | - Fix possible null exception at task finishing handling. | |
49 | ||
57bf289f JB |
50 | ### Changed |
51 | ||
52 | - Optimize Deque implementation to improve tasks queueing performance. | |
53 | ||
7cf320c9 JB |
54 | ## [3.1.18] - 2024-01-06 |
55 | ||
6d7beb8c JB |
56 | ### Fixed |
57 | ||
58 | - Fix dynamic pool with minimum number of workers set to zero: [#1748](https://github.com/poolifier/poolifier/issues/1748). | |
59 | ||
a4bc8d0e JB |
60 | ## [3.1.17] - 2024-01-05 |
61 | ||
2b6b412f JB |
62 | ### Changed |
63 | ||
64 | - Improve performance by clean up unneeded condition checks on hot code paths. | |
65 | ||
0d64fd53 JB |
66 | ## [3.1.16] - 2024-01-03 |
67 | ||
4302d959 JB |
68 | ### Fixed |
69 | ||
70 | - Add missing type to TS type definitions. | |
71 | ||
9122cc2c JB |
72 | ## [3.1.15] - 2024-01-02 |
73 | ||
a4d25410 JB |
74 | ### Fixed |
75 | ||
76 | - Fix CommonJS support with TypeScript: [#1821](https://github.com/poolifier/poolifier/issues/1821). | |
77 | ||
565b7e65 JB |
78 | ## [3.1.15-0] - 2024-01-02 |
79 | ||
63406ebd JB |
80 | ### Fixed |
81 | ||
a4d25410 | 82 | - Fix CommonJS support with TypeScript: [#1821](https://github.com/poolifier/poolifier/issues/1821). |
63406ebd | 83 | |
56412ef4 JB |
84 | ## [3.1.14] - 2024-01-01 |
85 | ||
e44639e9 JB |
86 | ### Fixed |
87 | ||
88 | - Properly handle dynamic pool with zero minimum size. | |
89 | ||
5e133e82 JB |
90 | ## [3.1.13] - 2023-12-30 |
91 | ||
b20bf19a JB |
92 | ### Changed |
93 | ||
94 | - Reduce branching in several hot code paths. | |
95 | - Use faster object cloning implementation. | |
96 | ||
60aa9f2f JB |
97 | ## [3.1.12] - 2023-12-27 |
98 | ||
28883f84 JB |
99 | ### Fixed |
100 | ||
101 | - Fix tasks redistribution triggers at pool destroying. | |
102 | ||
103 | ### Changed | |
104 | ||
105 | - Switch TypeScript module resolution to Node16. | |
106 | ||
164c80dd JB |
107 | ## [3.1.12-0] - 2023-12-27 |
108 | ||
f4ef37a8 JB |
109 | ### Fixed |
110 | ||
111 | - Fix tasks redistribution triggers at pool destroying. | |
112 | ||
0766991a JB |
113 | ## [3.1.11] - 2023-12-24 |
114 | ||
5eb72b9e JB |
115 | ### Fixed |
116 | ||
117 | - Avoid worker node cross tasks stealing. | |
118 | - Ensure only half the pool worker nodes can steal tasks. | |
119 | ||
4618ccfd JB |
120 | ## [3.1.10] - 2023-12-23 |
121 | ||
09616edb JB |
122 | ### Changed |
123 | ||
124 | - Avoid useless branching on pool type. | |
125 | ||
bba20209 JB |
126 | ## [3.1.9] - 2023-12-22 |
127 | ||
2889bd70 JB |
128 | ### Changed |
129 | ||
130 | - Readd ThreadPoolOptions and ClusterPoolOptions TS type aliases to PoolOptions. | |
131 | ||
b1bbc365 JB |
132 | ## [3.1.8] - 2023-12-21 |
133 | ||
ad3836ed JB |
134 | ### Fixed |
135 | ||
136 | - Fix default worker weight computation. | |
137 | - Fix possible null exception at pool destroying. | |
138 | ||
72523ab9 JB |
139 | ## [3.1.7] - 2023-12-20 |
140 | ||
55d7d600 JB |
141 | ### Fixed |
142 | ||
143 | - Ensure worker choice strategies implementation wait for worker node readiness: [#1748](https://github.com/poolifier/poolifier/issues/1748). | |
144 | ||
165f3d56 JB |
145 | ## [3.1.6] - 2023-12-18 |
146 | ||
85b2561d JB |
147 | ### Fixed |
148 | ||
149 | - Fix pool destroying with tasks queuing enabled. | |
150 | ||
6c8cec9e JB |
151 | ## [3.1.5] - 2023-12-18 |
152 | ||
32b141fd JB |
153 | ### Added |
154 | ||
155 | - Add queued tasks end timeout support to worker node termination. | |
156 | ||
f11ec29c JB |
157 | ## [3.1.4] - 2023-12-18 |
158 | ||
4e0afe97 JB |
159 | ### Fixed |
160 | ||
161 | - Make more robust the fix for possible null exception at handling task execution response. | |
162 | ||
f592ef16 JB |
163 | ## [3.1.3] - 2023-12-17 |
164 | ||
9b358e72 JB |
165 | ### Fixed |
166 | ||
167 | - Fix possible null exception at handling task execution response. | |
168 | ||
c61772e5 JB |
169 | ## [3.1.2] - 2023-12-17 |
170 | ||
87347ea8 JB |
171 | ### Fixed |
172 | ||
32b141fd | 173 | - Wait for queued tasks to end at worker node termination. |
87347ea8 | 174 | |
6e664bec JB |
175 | ## [3.1.1] - 2023-12-16 |
176 | ||
51280f9b JB |
177 | ### Fixed |
178 | ||
179 | - Fix pool options TS type definition. | |
180 | ||
5362c66b JB |
181 | ## [3.1.0] - 2023-12-16 |
182 | ||
c3719753 JB |
183 | ### Changed |
184 | ||
185 | - TypeScript breaking change: merge ThreadPoolOptions and ClusterPoolOptions types into PoolOptions type. | |
186 | ||
42321a2b JB |
187 | ## [3.0.14] - 2023-12-13 |
188 | ||
fa548cda JB |
189 | ### Fixed |
190 | ||
191 | - Fix possible null exception with worker_threads pools. | |
192 | ||
d727d871 JB |
193 | ## [3.0.13] - 2023-12-12 |
194 | ||
fb5a7307 JB |
195 | ### Fixed |
196 | ||
197 | - Ensure worker choice strategy wait for worker nodes readiness. | |
198 | ||
199 | ### Changed | |
200 | ||
201 | - Remove infinite retries support in worker choice strategy to avoid configuration leading to possible infinite recursion or loop. | |
202 | ||
90a43710 JB |
203 | ## [3.0.12] - 2023-12-12 |
204 | ||
9aa78bcb JB |
205 | ### Changed |
206 | ||
207 | - Add infinite retries support in worker choice strategy. | |
45a5a54c | 208 | |
d8163b08 JB |
209 | ## [3.0.11] - 2023-12-11 |
210 | ||
f18fd12b JB |
211 | ### Fixed |
212 | ||
457dd3dc | 213 | - Ensure pool asynchronous resource properly track tasks execution. |
f18fd12b | 214 | |
bd453998 JB |
215 | ## [3.0.10] - 2023-12-08 |
216 | ||
cb71d660 JB |
217 | ### Changed |
218 | ||
457dd3dc | 219 | - Add a fastpath when tasks stealing or redistribution is impossible. |
cb71d660 | 220 | |
d7164344 JB |
221 | ## [3.0.9] - 2023-11-26 |
222 | ||
78f60f82 JB |
223 | ### Fixed |
224 | ||
225 | - Remove all pool events listener at pool destroying. | |
226 | - Remove all worker node events listener at worker node destroying. | |
9f99eb9b | 227 | - Fix worker node event emitter listeners handling memory leak at pool options runtime change. |
78f60f82 | 228 | |
0c08a681 JB |
229 | ## [3.0.8] - 2023-11-25 |
230 | ||
463226a4 JB |
231 | ### Fixed |
232 | ||
457dd3dc | 233 | - Ensure continuous tasks stealing on idle start at worker node idling. |
463226a4 | 234 | |
14dad1fd JB |
235 | ## [3.0.7] - 2023-11-24 |
236 | ||
65542a35 JB |
237 | ### Changed |
238 | ||
239 | - Make continuous tasks stealing start at worker node idling. | |
240 | ||
82c5db63 JB |
241 | ## [3.0.6] - 2023-11-24 |
242 | ||
711623b8 JB |
243 | ### Fixed |
244 | ||
b51d8596 | 245 | - Ensure pool statuses are checked at initialization, `start()` or `destroy()`. |
55082af9 | 246 | - Ensure pool `ready` event can be emitted after several `start()/destroy()` cycles. |
711623b8 | 247 | |
5aa31a74 JB |
248 | ## [3.0.5] - 2023-10-27 |
249 | ||
d91689fd JB |
250 | ### Fixed |
251 | ||
55082af9 | 252 | - Ensure pool `ready` event can be emitted only once. |
d91689fd | 253 | |
597775b2 JB |
254 | ## [3.0.4] - 2023-10-20 |
255 | ||
03fb313b JB |
256 | ### Changed |
257 | ||
49d60f11 | 258 | - Switch to Bencher for benchmarking: [https://bencher.dev/perf/poolifier](https://bencher.dev/perf/poolifier). |
03fb313b JB |
259 | - Use builtin retry mechanism in worker choice strategies instead of custom one. |
260 | ||
6c285176 JB |
261 | ## [3.0.3] - 2023-10-19 |
262 | ||
9761e404 JB |
263 | ### Fixed |
264 | ||
265 | - Avoid null exception at sending message to worker. | |
535fd8d5 | 266 | - Avoid null exception at checking worker node readiness. |
9761e404 | 267 | |
358dc40f JB |
268 | ## [3.0.2] - 2023-10-17 |
269 | ||
97256a85 JB |
270 | ### Fixed |
271 | ||
c3c2b35e | 272 | - Fix race condition at dynamic worker node task assignment and scheduled removal. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468) and [#1496](https://github.com/poolifier/poolifier/issues/1496). |
97256a85 | 273 | |
7a570743 JB |
274 | ## [3.0.1] - 2023-10-16 |
275 | ||
dbfa7948 JB |
276 | ### Fixed |
277 | ||
fc84edac | 278 | - Workaround possible race condition at work nodes array element removal and querying. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468). |
dbfa7948 | 279 | |
365f13e4 JB |
280 | ### Changed |
281 | ||
c3c2b35e | 282 | - Switch the worker node eventing code to `EventTarget` API. |
365f13e4 | 283 | |
003b3275 JB |
284 | ## [3.0.0] - 2023-10-08 |
285 | ||
277c49bf JB |
286 | ### Changed |
287 | ||
288 | - Remove Node.js 16.x.x (EOL) support. | |
289 | ||
3c9e911a JB |
290 | ## [2.7.5] - 2023-10-03 |
291 | ||
f80125ca JB |
292 | ### Changed |
293 | ||
294 | - Use `EventEmitterAsyncResource` type from `@types/node` for pool event emitter. TypeScript users will need to update to latest `@types/node` version. | |
295 | ||
3466e757 JB |
296 | ## [2.7.4] - 2023-09-25 |
297 | ||
67b26ae2 JB |
298 | ### Fixed |
299 | ||
300 | - Fix source maps (bundler issue). | |
301 | ||
eeb1f961 JB |
302 | ## [2.7.3] - 2023-09-24 |
303 | ||
b5604034 JB |
304 | ### Changed |
305 | ||
306 | - Convert pool event emitter to event emitter async resource. | |
307 | ||
f2df6dc8 JB |
308 | ## [2.7.2] - 2023-09-23 |
309 | ||
116ca64b JB |
310 | ### Changed |
311 | ||
312 | - Add source maps to npm package to ease debugging. | |
313 | ||
1e319a70 JB |
314 | ### Added |
315 | ||
316 | - Continuous benchmarking versus other worker pools: [https://poolifier.github.io/benchmark](https://poolifier.github.io/benchmark). | |
317 | ||
aab2819b JB |
318 | ## [2.7.1] - 2023-09-20 |
319 | ||
ae036c3e JB |
320 | ### Fixed |
321 | ||
322 | - Ensure worker message listener used one time are removed after usage. | |
323 | ||
15d7c489 JB |
324 | ## [2.7.0] - 2023-09-19 |
325 | ||
160557ff JB |
326 | ### Fixed |
327 | ||
328 | - Fix task stealing related tasks queue options handling at runtime. | |
329 | ||
c3284191 JB |
330 | ### Changed |
331 | ||
332 | - Rename `listTaskFunctions()` to `listTaskFunctionNames()` in pool and worker API. | |
333 | ||
334 | ### Added | |
335 | ||
35808931 | 336 | - Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API: [PR #1148](https://github.com/poolifier/poolifier/pull/1148). |
c20084b6 | 337 | - Stricter worker constructor arguments validation. |
c3284191 | 338 | |
04054352 JB |
339 | ## [2.6.45] - 2023-09-17 |
340 | ||
093af25b JB |
341 | ### Changed |
342 | ||
343 | - Disable publication on GitHub packages registry on release until authentication issue is fixed. | |
09d9af02 JB |
344 | |
345 | ### Added | |
346 | ||
ce0ab2d7 | 347 | - Add `startWorkers` to pool options to whether start the minimum number of workers at pool initialization or not. |
cde5b54e | 348 | - Add `start()` method to pool API to start the minimum number of workers. |
af98b972 | 349 | - Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing under back pressure or not. |
1e319a70 | 350 | - Continuous internal benchmarking: [https://poolifier.github.io/benchmark-results/dev/bench](https://poolifier.github.io/benchmark-results/dev/bench). |
f1c674cd | 351 | |
bce9ffdf JB |
352 | ## [2.6.44] - 2023-09-08 |
353 | ||
4cb259d3 JB |
354 | ### Fixed |
355 | ||
356 | - Use a dedicated PAT to publish on GitHub packages registry. | |
357 | ||
358 | ### Added | |
359 | ||
360 | - Publish on GitHub packages registry on release. | |
361 | ||
362 | ### Changed | |
363 | ||
364 | - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128). | |
365 | ||
fbda1e26 JB |
366 | ## [2.6.43] - 2023-09-08 |
367 | ||
15fc82ba JB |
368 | ### Added |
369 | ||
4cb259d3 | 370 | - Publish on GitHub packages registry on release. |
15fc82ba JB |
371 | |
372 | ### Changed | |
373 | ||
4cb259d3 | 374 | - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128). |
15fc82ba | 375 | |
b47306a3 JB |
376 | ## [2.6.42] - 2023-09-06 |
377 | ||
ad11ca81 JB |
378 | ### Changed |
379 | ||
380 | - Optimize hot code paths implementation: avoid unnecessary branching, add and use optimized helpers (min, max), use reduce() array helper, ... | |
381 | ||
1b37751d JB |
382 | ## [2.6.41] - 2023-09-03 |
383 | ||
f3a91bac JB |
384 | ### Changed |
385 | ||
386 | - Optimize worker choice strategies implementation. | |
387 | ||
7790a494 JB |
388 | ## [2.6.40] - 2023-09-01 |
389 | ||
6fe200b4 JB |
390 | ### Fixed |
391 | ||
392 | - Do not pre-choose in WRR worker choice strategy to avoid bias. | |
68738842 | 393 | - Avoid array out of bound in worker choice strategies after worker node removal. |
6fe200b4 | 394 | |
766c7f84 JB |
395 | ## [2.6.39] - 2023-08-30 |
396 | ||
edf8ce4e JB |
397 | ### Fixed |
398 | ||
4cb259d3 | 399 | - Fix race condition in worker choice strategies at worker node info querying while not yet initialized. |
edf8ce4e | 400 | |
904a5689 JB |
401 | ## [2.6.38] - 2023-08-30 |
402 | ||
b40c4b06 JB |
403 | ### Added |
404 | ||
405 | - Bundle typescript types declaration into one file. | |
406 | ||
619f403b JB |
407 | ### Changed |
408 | ||
409 | - Improve interleaved weighted round robin worker choice strategy implementation. | |
410 | ||
5a24d71c JB |
411 | ## [2.6.37] - 2023-08-28 |
412 | ||
bdb9d712 JB |
413 | ### Fixed |
414 | ||
415 | - Ensure unused worker usage statistics are deleted at runtime. | |
416 | ||
8c0b113f JB |
417 | ### Changed |
418 | ||
419 | - Rename worker choice strategy options `choiceRetries` to `retries`. | |
574c5c8d | 420 | - Avoid unnecessary branching in worker choice strategies. |
8c0b113f | 421 | |
ba821940 JB |
422 | ## [2.6.36] - 2023-08-27 |
423 | ||
9d2d0da1 JB |
424 | ### Fixed |
425 | ||
426 | - Fix pool `execute()` arguments check. | |
427 | ||
1f0766e7 JB |
428 | ### Changed |
429 | ||
430 | - Make continuous tasks stealing algorithm less aggressive. | |
8780236f | 431 | - Fine tune tasks stealing algorithm under back pressure. |
1f0766e7 | 432 | |
ffd2c1ff JB |
433 | ## [2.6.35] - 2023-08-25 |
434 | ||
dc021bcc JB |
435 | ### Fixed |
436 | ||
437 | - Don't account worker usage statistics for tasks that have failed. | |
3baa0837 | 438 | - Fix pool information runtime and wait time median computation. |
dc021bcc JB |
439 | |
440 | ### Changed | |
441 | ||
442 | - Update simple moving average implementation to use a circular buffer. | |
443 | - Update simple moving median implementation to use a circular buffer. | |
68cbdc84 JB |
444 | - Account for stolen tasks in worker usage statistics and pool information. |
445 | ||
446 | ### Added | |
447 | ||
448 | - Continuous tasks stealing algorithm. | |
dc021bcc | 449 | |
c58bc2a1 JB |
450 | ## [2.6.34] - 2023-08-24 |
451 | ||
0bc68267 JB |
452 | ### Fixes |
453 | ||
454 | - Avoid cascading tasks stealing under back pressure. | |
455 | ||
456 | ### Changed | |
457 | ||
458 | - Add fastpath to queued tasks rescheduling. | |
459 | ||
39fb7ad0 JB |
460 | ## [2.6.33] - 2023-08-24 |
461 | ||
dd951876 JB |
462 | ### Fixed |
463 | ||
464 | - Fix queued tasks rescheduling. | |
465 | ||
ff3f866a JB |
466 | ### Changed |
467 | ||
468 | - Rename tasks queue options `queueMaxSize` to `size`. | |
469 | ||
a6b3272b | 470 | ### Added |
dd951876 | 471 | |
a6b3272b | 472 | - Task stealing scheduling algorithm if tasks queueing is enabled. |
dd951876 | 473 | |
c55c9b5d JB |
474 | ## [2.6.32] - 2023-08-23 |
475 | ||
15b176e0 JB |
476 | ### Fixed |
477 | ||
478 | - Ensure no task can be executed when the pool is destroyed. | |
479 | ||
20c6f652 JB |
480 | ### Added |
481 | ||
482 | - Add `queueMaxSize` option to tasks queue options. | |
574b351d | 483 | - Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing. |
72695f86 | 484 | - Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled. |
20c6f652 | 485 | |
e560a9f2 JB |
486 | ## [2.6.31] - 2023-08-20 |
487 | ||
b1aae695 JB |
488 | ### Fixed |
489 | ||
3e8611a8 | 490 | - Fix worker choice strategy retries mechanism in some edge cases. |
b1aae695 | 491 | |
94407def JB |
492 | ### Changed |
493 | ||
e695d66f | 494 | - Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage. |
a71b05bc | 495 | - Remove the experimental status of the `LEAST_ELU` worker choice strategy. |
94407def | 496 | |
962b9863 JB |
497 | ## [2.6.30] - 2023-08-19 |
498 | ||
33e6bb4c JB |
499 | ### Fixed |
500 | ||
501 | - Ensure pool event `backPressure` is emitted. | |
502 | - Ensure pool event `full` is emitted only once. | |
8735b4e5 | 503 | - Ensure worker node cannot be instantiated without proper arguments. |
33e6bb4c | 504 | |
8cc4ea81 JB |
505 | ## [2.6.29] - 2023-08-18 |
506 | ||
6169563b JB |
507 | ### Fixed |
508 | ||
55082af9 | 509 | - Fix race condition between readiness and task functions worker message handling at startup. |
5dd4043c | 510 | - Fix duplicate task function worker usage statistics computation per task function. |
db0e38ee | 511 | - Update task function worker usage statistics if and only if there's at least two different task functions. |
5bb5be17 | 512 | - Fix race condition at task function worker usage executing task computation leading to negative value. |
6169563b | 513 | |
8990357d JB |
514 | ### Added |
515 | ||
445264e8 | 516 | - Add back pressure detection on the worker node queue. Event `backPressure` is emitted when all worker node queues are full (worker node queue size >= poolMaxSize^2). |
8990357d JB |
517 | - Use back pressure detection in worker choice strategies. |
518 | - Add worker choice strategies retries mechanism if no worker is eligible. | |
519 | ||
21157987 JB |
520 | ## [2.6.28] - 2023-08-16 |
521 | ||
f05ed93c JB |
522 | ### Fixed |
523 | ||
524 | - Ensure pool workers are properly initialized. | |
525 | ||
12d67776 JB |
526 | ### Added |
527 | ||
528 | - HTTP server pool examples: express-cluster, express-hybrid. | |
529 | ||
d18fccb1 JB |
530 | ### Changed |
531 | ||
532 | - Remove now useless branching in worker hot code path. | |
533 | ||
741cdb34 JB |
534 | ## [2.6.27] - 2023-08-15 |
535 | ||
50e7f498 JB |
536 | ### Fixed |
537 | ||
538 | - Add `KillHandler` type definition to exported types. | |
539 | ||
ef3891a3 JB |
540 | ### Added |
541 | ||
542 | - Add `destroy` event to pool API. | |
543 | ||
e9dc6efa JB |
544 | ## [2.6.26] - 2023-08-15 |
545 | ||
2b099bf7 JB |
546 | ### Added |
547 | ||
548 | - Add kill handler to worker options allowing to execute custom code when worker is killed. | |
ef3891a3 | 549 | - Add `listTaskFunctions()` method to pool API. |
1f4553c6 | 550 | - SMTP client pool example: nodemailer. |
2b099bf7 | 551 | |
5b726f72 JB |
552 | ## [2.6.25] - 2023-08-13 |
553 | ||
72855e92 JB |
554 | ### Added |
555 | ||
3b311539 | 556 | - HTTP server pool examples: fastify-cluster, fastify-hybrid. |
02999424 | 557 | - WebSocket server pool examples: ws-cluster, ws-hybrid. |
72855e92 | 558 | |
7aadd6e5 JB |
559 | ## [2.6.24] - 2023-08-12 |
560 | ||
7d91a8cd JB |
561 | ### Added |
562 | ||
563 | - Add array of transferable objects to the `execute()` method arguments. | |
02999424 | 564 | - WebSocket server pool examples: ws-worker_threads. |
7d91a8cd | 565 | |
6b4263b4 JB |
566 | ## [2.6.23] - 2023-08-11 |
567 | ||
3d76750a | 568 | ### Fixed |
8e0af894 | 569 | |
3d76750a | 570 | - Fix pool busyness semantic when tasks queueing is enabled: the pool is busy when the number of executing tasks on each worker has reached the maximum tasks concurrency per worker. |
9606b474 | 571 | |
3d76750a JB |
572 | ### Added |
573 | ||
574 | - HTTP client pool examples: fetch, node-fetch and axios with multiple task functions. | |
02999424 | 575 | - HTTP server pool examples: express-worker_threads, fastify-worker_threads. |
3d76750a JB |
576 | |
577 | ## [2.6.22] - 2023-08-10 | |
9606b474 | 578 | |
3d76750a | 579 | ### Fixed |
9606b474 JB |
580 | |
581 | - Add missing `types` field to package.json `exports`. | |
582 | ||
3d76750a JB |
583 | ### Changed |
584 | ||
585 | - Structure markdown documentation (PR #811). | |
586 | ||
d9647bdd JB |
587 | ## [2.6.21] - 2023-08-03 |
588 | ||
2111ec12 JB |
589 | ### Changed |
590 | ||
591 | - Improve code documentation. | |
592 | - Code refactoring and cleanup for better maintainability and readability. | |
593 | ||
5c30b9d9 JB |
594 | ## [2.6.20] - 2023-07-21 |
595 | ||
10ecf8fd JB |
596 | ### Fixed |
597 | ||
598 | - Fix queued tasks redistribution on error task execution starvation. | |
a1763c54 | 599 | - Ensure tasks queueing per worker condition is untangled from the pool busyness semantic. |
10ecf8fd | 600 | |
aa9eede8 JB |
601 | ### Changed |
602 | ||
7c89e6a4 | 603 | - Drastically reduce lookups by worker in the worker nodes. |
aa9eede8 | 604 | |
62485908 JB |
605 | ## [2.6.19] - 2023-07-20 |
606 | ||
2e2ef9c3 JB |
607 | ### Added |
608 | ||
609 | - Dedicated internal communication channel for worker_threads pools. | |
610 | ||
8f4c9491 JB |
611 | ## [2.6.18] - 2023-07-19 |
612 | ||
8660b972 JB |
613 | ### Changed |
614 | ||
615 | - Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller. | |
616 | ||
206a3519 JB |
617 | ## [2.6.17] - 2023-07-16 |
618 | ||
b4899fae JB |
619 | ### Added |
620 | ||
1a3e01ba | 621 | - Add `listTaskFunctions()` method to worker API. |
b4899fae | 622 | |
58a06a6c JB |
623 | ## [2.6.16] - 2023-07-12 |
624 | ||
2a69b8c5 JB |
625 | ### Fixed |
626 | ||
80520ca4 | 627 | - Fix pool startup detection. |
2a69b8c5 JB |
628 | - Fix worker task functions handling. |
629 | ||
b5900b02 JB |
630 | ## [2.6.15] - 2023-07-11 |
631 | ||
19dbc45b JB |
632 | ### Added |
633 | ||
634 | - Take into account worker node readiness in worker choice strategies. | |
635 | ||
4a0db581 JB |
636 | ## [2.6.14] - 2023-07-10 |
637 | ||
87e44747 JB |
638 | ### Fixed |
639 | ||
640 | - Fix task function statistics tracking. | |
641 | ||
0265272f JB |
642 | ## [2.6.13] - 2023-07-10 |
643 | ||
968a2e8c JB |
644 | ### Added |
645 | ||
646 | - Add per task function statistics tracking. | |
782299f8 | 647 | - Add public methods to manipulate the worker task functions at runtime. |
968a2e8c | 648 | |
44c8c00f JB |
649 | ## [2.6.12] - 2023-07-09 |
650 | ||
aa4bf4b2 JB |
651 | ### Fixed |
652 | ||
653 | - Workaround import issue with `node:os` module in node 16.x.x. | |
654 | ||
b7cfced1 JB |
655 | ## [2.6.11] - 2023-07-09 |
656 | ||
d5024c00 JB |
657 | ### Fixed |
658 | ||
659 | - Fix pool readiness semantic. | |
660 | ||
f313a208 JB |
661 | ## [2.6.10] - 2023-07-08 |
662 | ||
2431bdb4 JB |
663 | ### Fixed |
664 | ||
665 | - Ensure workers are not recreated on error at pool startup. | |
666 | ||
667 | ### Added | |
668 | ||
669 | - Add `ready` and `strategy` fields to pool information. | |
670 | - 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 | 671 | - Add dynamic pool sizing checks. |
2431bdb4 | 672 | |
369d0a51 JB |
673 | ## [2.6.9] - 2023-07-07 |
674 | ||
2845f2a5 JB |
675 | ### Fixed |
676 | ||
677 | - Recreate the right worker type on uncaught exception. | |
678 | ||
679 | ### Added | |
680 | ||
681 | - Add minimum and maximum to internal measurement statistics. | |
1dcf8b7b | 682 | - Add `runTime` and `waitTime` to pool information. |
75d3401a | 683 | - Check worker inactive time only on dynamic worker. |
2845f2a5 | 684 | |
fc97d613 JB |
685 | ## [2.6.8] - 2023-07-03 |
686 | ||
92b1feaa JB |
687 | ### Fixed |
688 | ||
689 | - Brown paper bag release to fix version handling in pool information. | |
690 | ||
52d54060 JB |
691 | ## [2.6.7] - 2023-07-03 |
692 | ||
5bc91f3e JB |
693 | ### Fixed |
694 | ||
695 | - Ensure worker queued tasks at error are reassigned to other pool workers. | |
696 | ||
afe0d5bf JB |
697 | ### Added |
698 | ||
699 | - Add pool `utilization` ratio to pool information. | |
23ccf9d7 | 700 | - Add `version` to pool information. |
e5b3047d | 701 | - Add worker information to worker nodes. |
afe0d5bf | 702 | |
f42c583f JB |
703 | ## [2.6.6] - 2023-07-01 |
704 | ||
6961ca9a JB |
705 | ### Added |
706 | ||
d5e3c4ff | 707 | - Add safe helper `availableParallelism()` to help sizing the pool. |
6961ca9a | 708 | |
3749facb JB |
709 | ### Fixed |
710 | ||
711 | - Ensure message handler is only registered in worker. | |
712 | ||
6fed2513 JB |
713 | ## [2.6.5] - 2023-06-27 |
714 | ||
c72f6987 JB |
715 | ### Known issues |
716 | ||
70726c28 | 717 | - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782 |
c72f6987 JB |
718 | |
719 | ### Fixed | |
720 | ||
721 | - Artificial version bump to 2.6.5 to workaround publication issue. | |
d5e3c4ff | 722 | - Ensure cluster pool `destroy()` gracefully shutdowns worker's server. |
c72f6987 JB |
723 | - Ensure pool event is emitted before task error promise rejection. |
724 | - Fix queued tasks count computation. | |
725 | ||
726 | ### Removed | |
727 | ||
2fbe1783 | 728 | - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC. |
c72f6987 | 729 | |
6426631b JB |
730 | ## [2.6.4] - 2023-06-27 |
731 | ||
941f9a7c JB |
732 | ### Known issues |
733 | ||
70726c28 | 734 | - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782 |
941f9a7c | 735 | |
2c039e43 JB |
736 | ### Fixed |
737 | ||
d5e3c4ff | 738 | - Ensure cluster pool `destroy()` gracefully shutdowns worker's server. |
2c039e43 | 739 | - Ensure pool event is emitted before task error promise rejection. |
9c16fb4b | 740 | - Fix queued tasks count computation. |
2c039e43 | 741 | |
941f9a7c JB |
742 | ### Removed |
743 | ||
2fbe1783 | 744 | - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC. |
941f9a7c | 745 | |
bc1b0765 JB |
746 | ## [2.6.3] - 2023-06-19 |
747 | ||
a6a2dc4c JB |
748 | ### Fixed |
749 | ||
750 | - Ensure no tasks are queued when trying to soft kill a dynamic worker. | |
f0d7f803 | 751 | - Update strategies internals after statistics computation. |
a6a2dc4c | 752 | |
7b56f532 JB |
753 | ### Changed |
754 | ||
755 | - Optimize O(1) queue implementation. | |
756 | ||
b628596c JB |
757 | ## [2.6.2] - 2023-06-12 |
758 | ||
a9e89d00 JB |
759 | ### Fixed |
760 | ||
761 | - Fix new worker use after creation in dynamic pool given the current worker choice strategy. | |
762 | ||
4368a898 JB |
763 | ## [2.6.1] - 2023-06-10 |
764 | ||
931d43e2 JB |
765 | ### Added |
766 | ||
13ab5b87 | 767 | - Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md). |
931d43e2 | 768 | |
f1c06930 JB |
769 | ### Fixed |
770 | ||
771 | - Fix average statistics computation: ensure failed tasks are not accounted. | |
772 | ||
16671b07 JB |
773 | ## [2.6.0] - 2023-06-09 |
774 | ||
a1347286 JB |
775 | ### Added |
776 | ||
5af9c0f7 | 777 | - Add `LEAST_ELU` worker choice strategy (experimental). |
9adcefab | 778 | - Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy. |
a1347286 | 779 | |
1c6fe997 JB |
780 | ### Changed |
781 | ||
782 | - Refactor pool worker node usage internals. | |
477f48e7 | 783 | - Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed. |
f63a9dda | 784 | - Breaking change: pool information `info` property object fields have been renamed. |
1c6fe997 JB |
785 | |
786 | ### Fixed | |
787 | ||
788 | - Fix wait time accounting. | |
789 | - Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time. | |
790 | - Ensure worker choice strategy `LEAST_USED` accounts also queued tasks. | |
791 | ||
aa07d6ee JB |
792 | ## [2.5.4] - 2023-06-07 |
793 | ||
b6b32453 JB |
794 | ### Added |
795 | ||
796 | - Add Event Loop Utilization (ELU) statistics to worker tasks usage. | |
797 | ||
798 | ### Changed | |
799 | ||
800 | - Compute statistics at the worker level only if needed. | |
2fbe1783 | 801 | - Add `worker_threads` options to thread pool options. |
b6b32453 | 802 | |
272d4d8f JB |
803 | ### Fixed |
804 | ||
805 | - Make the `LEAST_BUSY` strategy only relies on task runtime. | |
806 | ||
ed47fb3d JB |
807 | ## [2.5.3] - 2023-06-04 |
808 | ||
89a4abfd JB |
809 | ### Changed |
810 | ||
811 | - Refine pool information content. | |
b4213b7f | 812 | - Limit pool internals public exposure. |
89a4abfd | 813 | |
8a9febf5 JB |
814 | ## [2.5.2] - 2023-06-02 |
815 | ||
91ee39ed JB |
816 | ### Added |
817 | ||
818 | - Add `taskError` pool event for task execution error. | |
6b27d407 | 819 | - Add pool information `info` property to pool. |
91ee39ed JB |
820 | - Emit pool information on `busy` and `full` pool events. |
821 | ||
8babb151 JB |
822 | ## [2.5.1] - 2023-06-01 |
823 | ||
0e05c4dc JB |
824 | ### Added |
825 | ||
1f68cede | 826 | - Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`. |
91ee39ed | 827 | - Add `error` pool event for uncaught worker error. |
0e05c4dc | 828 | |
a8766181 JB |
829 | ## [2.5.0] - 2023-05-31 |
830 | ||
e4543b14 JB |
831 | ### Added |
832 | ||
833 | - Switch pool event emitter to `EventEmitterAsyncResource`. | |
6da80d38 | 834 | - Add tasks wait time accounting in per worker tasks usage. |
5af9c0f7 | 835 | - Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental). |
e4543b14 JB |
836 | |
837 | ### Changed | |
838 | ||
839 | - Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`. | |
840 | ||
570efb11 JB |
841 | ## [2.4.14] - 2023-05-09 |
842 | ||
b0f28bad JB |
843 | ### Fixed |
844 | ||
845 | - Ensure no undefined task runtime can land in the tasks history. | |
846 | - Fix median computation implementation once again. | |
847 | ||
110b6d13 JB |
848 | ### Added |
849 | ||
850 | - Unit tests for median and queue implementations. | |
851 | ||
72584880 JB |
852 | ## [2.4.13] - 2023-05-08 |
853 | ||
b0d6ed8f JB |
854 | ### Fixed |
855 | ||
e3058615 | 856 | - Fix worker choice strategy options validation. |
b0d6ed8f JB |
857 | - Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission. |
858 | ||
06140c32 JB |
859 | ## [2.4.12] - 2023-05-06 |
860 | ||
a86b6df1 JB |
861 | ### Added |
862 | ||
863 | - Support multiple task functions per worker. | |
08f3f44c | 864 | - Add custom worker weights support to worker choice strategies options. |
a86b6df1 | 865 | |
29ee7e9a JB |
866 | ### Changed |
867 | ||
868 | - Use O(1) queue implementation for tasks queueing. | |
869 | ||
0682ba15 JB |
870 | ### Fixed |
871 | ||
872 | - Fix median computation implementation. | |
873 | - Fix fair share worker choice strategy internals update. | |
874 | ||
936d53ec JB |
875 | ## [2.4.11] - 2023-04-23 |
876 | ||
cb70b19d JB |
877 | ### Changed |
878 | ||
879 | - Optimize free worker finding in worker choice strategies. | |
880 | ||
15bb637a JB |
881 | ## [2.4.10] - 2023-04-15 |
882 | ||
ef41a6e6 JB |
883 | ### Fixed |
884 | ||
82ea6492 | 885 | - Fix typescript type definition for task function: ensure the input data is optional. |
ef41a6e6 JB |
886 | - Fix typescript type definition for pool execute(): ensure the input data is optional. |
887 | ||
181eb2b4 JB |
888 | ## [2.4.9] - 2023-04-15 |
889 | ||
a20f0ba5 JB |
890 | ### Added |
891 | ||
892 | - Add tasks queue enablement runtime setter to pool. | |
893 | - Add tasks queue options runtime setter to pool. | |
894 | - Add worker choice strategy options runtime setter to pool. | |
895 | ||
896 | ### Changed | |
897 | ||
898 | - Remove the tasks queuing experimental status. | |
899 | ||
d4aeae5a JB |
900 | ### Fixed |
901 | ||
82ea6492 | 902 | - Fix task function type definition and validation. |
2fc5cae3 | 903 | - Fix worker choice strategy options handling. |
d4aeae5a | 904 | |
1d9e7023 JB |
905 | ## [2.4.8] - 2023-04-12 |
906 | ||
f9b4bbf8 JB |
907 | ### Fixed |
908 | ||
909 | - Fix message between main worker and worker type definition for tasks. | |
910 | - Fix code documentation. | |
911 | ||
12ae3210 JB |
912 | ## [2.4.7] - 2023-04-11 |
913 | ||
7171d33f JB |
914 | ### Added |
915 | ||
916 | - Add worker tasks queue options to pool options. | |
917 | ||
e8bd29ce JB |
918 | ### Fixed |
919 | ||
920 | - Fix missing documentation. | |
921 | ||
42c7bc10 JB |
922 | ## [2.4.6] - 2023-04-10 |
923 | ||
681196cc JB |
924 | ### Fixed |
925 | ||
926 | - Ensure one task at a time is executed per worker with tasks queueing enabled. | |
1c6fe997 | 927 | - Properly count worker executing tasks with tasks queueing enabled. |
681196cc | 928 | |
54d360e3 JB |
929 | ## [2.4.5] - 2023-04-09 |
930 | ||
3fafb1b2 JB |
931 | ### Added |
932 | ||
9e775f96 JB |
933 | - Use monotonic high resolution timer for worker tasks runtime. |
934 | - Add worker tasks median runtime to statistics. | |
ff733df7 | 935 | - Add worker tasks queue (experimental). |
3fafb1b2 | 936 | |
92fa3eb6 JB |
937 | ## [2.4.4] - 2023-04-07 |
938 | ||
aee46736 JB |
939 | ### Added |
940 | ||
941 | - Add `PoolEvents` enumeration and `PoolEvent` type. | |
942 | ||
36b5e78f JB |
943 | ### Fixed |
944 | ||
ff0c2b3e | 945 | - Destroy worker only on alive check. |
36b5e78f | 946 | |
9fb0f324 JB |
947 | ## [2.4.3] - 2023-04-07 |
948 | ||
28cf3617 JB |
949 | ### Fixed |
950 | ||
951 | - Fix typedoc generation with inheritance. | |
952 | ||
848f0f27 JB |
953 | ## [2.4.2] - 2023-04-06 |
954 | ||
164d950a JB |
955 | ### Added |
956 | ||
957 | - Add `full` event to dynamic pool. | |
32417142 | 958 | - Keep worker choice strategy in memory for conditional reuse. |
164d950a | 959 | |
78ab2555 JB |
960 | ### Fixed |
961 | ||
962 | - Fix possible negative worker key at worker removal in worker choice strategies. | |
963 | ||
79aafe9f JB |
964 | ## [2.4.1] - 2023-04-05 |
965 | ||
9cd39dd4 JB |
966 | ### Changed |
967 | ||
968 | - Optimize worker choice strategy for dynamic pool. | |
969 | ||
965415bb JB |
970 | ### Fixed |
971 | ||
972 | - Ensure dynamic pool does not alter worker choice strategy expected behavior. | |
973 | ||
d8b60b1c JB |
974 | ## [2.4.0] - 2023-04-04 |
975 | ||
c6bd2650 JB |
976 | ### Added |
977 | ||
978 | - Add `LESS_BUSY` worker choice strategy. | |
979 | ||
980 | ### Changed | |
981 | ||
982 | - Optimize worker storage in pool. | |
983 | - Optimize worker alive status check. | |
984 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
985 | - Optimize `LESS_USED` worker choice strategy. | |
2a87030e | 986 | - Update benchmark versus external threads pools. |
c6bd2650 JB |
987 | - Optimize tasks usage statistics requirements for worker choice strategy. |
988 | ||
989 | ### Fixed | |
990 | ||
991 | - Ensure trimmable characters are checked at pool initialization. | |
992 | - Fix message id integer overflow. | |
993 | - Fix pool worker removal in worker choice strategy internals. | |
994 | - Fix package publication with pnpm. | |
995 | ||
d0a3f018 JB |
996 | ## [2.4.0-3] - 2023-04-04 |
997 | ||
b2ede285 JB |
998 | ### Added |
999 | ||
1000 | - Add `LESS_BUSY` worker choice strategy. | |
1001 | ||
1002 | ### Changed | |
1003 | ||
1004 | - Optimize worker storage in pool. | |
1005 | - Optimize worker alive status check. | |
1006 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
1007 | - Optimize `LESS_USED` worker choice strategy. | |
2a87030e | 1008 | - Update benchmark versus external threads pools. |
b2ede285 JB |
1009 | |
1010 | ### Fixed | |
1011 | ||
1012 | - Ensure trimmable characters are checked at pool initialization. | |
1013 | - Fix message id integer overflow. | |
1014 | - Fix pool worker removal in worker choice strategy internals. | |
1015 | - Fix package publication with pnpm. | |
1016 | ||
a015ea40 JB |
1017 | ## [2.4.0-2] - 2023-04-03 |
1018 | ||
698f4bbc JB |
1019 | ### Added |
1020 | ||
1021 | - Add `LESS_BUSY` worker choice strategy. | |
1022 | ||
1023 | ### Changed | |
1024 | ||
1025 | - Optimize worker storage in pool. | |
1026 | - Optimize worker alive status check. | |
1027 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
1028 | - Optimize `LESS_USED` worker choice strategy. | |
1029 | ||
1030 | ### Fixed | |
1031 | ||
1032 | - Ensure trimmable characters are checked at pool initialization. | |
1033 | - Fix message id integer overflow. | |
1034 | - Fix pool worker removal in worker choice strategy internals. | |
1035 | - Fix package publication with pnpm. | |
1036 | ||
8fe15920 JB |
1037 | ## [2.4.0-1] - 2023-04-03 |
1038 | ||
5b301c28 JB |
1039 | ### Added |
1040 | ||
1041 | - Add `LESS_BUSY` worker choice strategy. | |
1042 | ||
1043 | ### Changed | |
1044 | ||
1045 | - Optimize worker storage in pool. | |
1046 | - Optimize worker alive status check. | |
1047 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
1048 | - Optimize `LESS_USED` worker choice strategy. | |
1049 | ||
1050 | ### Fixed | |
1051 | ||
1052 | - Ensure trimmable characters are checked at pool initialization. | |
1053 | - Fix message id integer overflow. | |
1054 | - Fix pool worker removal in worker choice strategy internals. | |
1055 | ||
2fb9ca9c JB |
1056 | ## [2.4.0-0] - 2023-04-03 |
1057 | ||
168c526f JB |
1058 | ### Added |
1059 | ||
1060 | - Add `LESS_BUSY` worker choice strategy. | |
1061 | ||
1d71a908 JB |
1062 | ### Changed |
1063 | ||
ffcbbad8 | 1064 | - Optimize worker storage in pool. |
1d71a908 | 1065 | - Optimize worker alive status check. |
65a60b3b | 1066 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. |
737c6d97 | 1067 | - Optimize `LESS_USED` worker choice strategy. |
1d71a908 | 1068 | |
ffcbbad8 JB |
1069 | ### Fixed |
1070 | ||
1071 | - Ensure trimmable characters are checked at pool initialization. | |
b4e75778 | 1072 | - Fix message id integer overflow. |
97a2abc3 | 1073 | - Fix pool worker removal in worker choice strategy internals. |
ffcbbad8 | 1074 | |
08372738 JB |
1075 | ## [2.3.10] - 2023-03-18 |
1076 | ||
710826bc JB |
1077 | ### Fixed |
1078 | ||
9606b474 | 1079 | - Fix package.json `exports` syntax for ESM and CommonJS. |
710826bc JB |
1080 | |
1081 | ### Changed | |
1082 | ||
1083 | - Permit SemVer pre-release publication. | |
76e5ac6f | 1084 | |
e4796ecd JB |
1085 | ## [2.3.10-2] - 2023-03-18 |
1086 | ||
6abad580 JB |
1087 | ### Fixed |
1088 | ||
9606b474 | 1089 | - Fix package.json `exports` syntax for ESM and CommonJS. |
6abad580 | 1090 | |
a2ee98cc JB |
1091 | ## [2.3.10-1] - 2023-03-18 |
1092 | ||
7e060cee JB |
1093 | ### Changed |
1094 | ||
90483887 | 1095 | - Permit SemVer pre-release publication. |
7e060cee | 1096 | |
c81bfafb JB |
1097 | ## [2.3.10-0] - 2023-03-18 |
1098 | ||
fe18768d JB |
1099 | ### Fixed |
1100 | ||
9606b474 | 1101 | - Fix package.json `exports` syntax for ESM and CommonJS. |
fe18768d | 1102 | |
d7b78217 JB |
1103 | ## [2.3.9] - 2023-03-18 |
1104 | ||
ed6dd37f JB |
1105 | ### Changed |
1106 | ||
1107 | - Introduce ESM module support along with CommonJS one. | |
1108 | ||
1109 | ### Fixed | |
1110 | ||
1111 | - Fix brown paper bag bug referencing the same object literal. | |
1112 | ||
68e2ad86 JB |
1113 | ## [2.3.8] - 2023-03-18 |
1114 | ||
ca6c7d70 JB |
1115 | ### Changed |
1116 | ||
1117 | - Switch internal benchmarking code to benny. | |
fbdedeb9 JB |
1118 | - Switch to TypeScript 5.x.x. |
1119 | - Switch rollup bundler plugins to core ones. | |
ed6dd37f | 1120 | - Switch to TSDoc syntax. |
fbdedeb9 | 1121 | - Enforce conventional commits. |
ca6c7d70 | 1122 | |
d15211d4 JB |
1123 | ### Fixed |
1124 | ||
1125 | - Fix random integer generator. | |
fbdedeb9 | 1126 | - Fix worker choice strategy pool type identification at initialization. |
d15211d4 | 1127 | |
995705ea JB |
1128 | ## [2.3.7] - 2022-10-23 |
1129 | ||
b953022b JB |
1130 | ### Changed |
1131 | ||
1132 | - Switch to open collective FOSS project funding platform. | |
78cea37e JB |
1133 | - Switch to ts-standard linter configuration on TypeScript code. |
1134 | ||
1135 | ### Fixed | |
1136 | ||
1137 | - Fixed missing async on pool execute method. | |
1138 | - Fixed typing in TypeScript example. | |
1139 | - Fixed types in unit tests. | |
b953022b | 1140 | |
3b9f6953 JB |
1141 | ## [2.3.6] - 2022-10-22 |
1142 | ||
f80cead4 JB |
1143 | ### Changed |
1144 | ||
1145 | - Cleanup pool attributes and methods. | |
1146 | - Refine error types thrown. | |
1147 | ||
1148 | ### Fixed | |
1149 | ||
1150 | - Fix continuous integration build on windows. | |
1151 | - Fix code coverage reporting by using c8 instead of nyc. | |
1152 | ||
efc22107 JB |
1153 | ## [2.3.5] - 2022-10-21 |
1154 | ||
7a6a0a96 JB |
1155 | ### Changed |
1156 | ||
a05c10de JB |
1157 | - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter. |
1158 | - Optimize tasks usage lookup implementation. | |
7a6a0a96 | 1159 | |
b4904890 JB |
1160 | ### Fixed |
1161 | ||
1162 | - Fix missed pool event emitter type export. | |
1163 | - Fix typedoc documentation generation. | |
1164 | ||
a875f8d1 JB |
1165 | ## [2.3.4] - 2022-10-17 |
1166 | ||
73cda448 JB |
1167 | ### Added |
1168 | ||
1169 | - Fully automate release process with release-it. | |
1170 | ||
45a5a54c JB |
1171 | ### Changed |
1172 | ||
73cda448 | 1173 | - Optimize fair share task scheduling algorithm implementation. |
2a87030e | 1174 | - Update benchmark versus external pools results with latest version. |
45a5a54c | 1175 | |
90ee1b18 | 1176 | ## [2.3.3] - 2022-10-15 |
1a76932b JB |
1177 | |
1178 | ### Added | |
1179 | ||
1180 | - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options. | |
1181 | ||
90ee1b18 | 1182 | ## [2.3.2] - 2022-10-14 |
11df3590 JB |
1183 | |
1184 | ### Changed | |
1185 | ||
1186 | - Optimize fair share worker selection strategy implementation. | |
1187 | ||
1188 | ### Fixed | |
1189 | ||
1190 | - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled. | |
1191 | ||
90ee1b18 | 1192 | ## [2.3.1] - 2022-10-13 |
23ff945a JB |
1193 | |
1194 | ### Added | |
1195 | ||
1196 | - Pool worker choice strategies: | |
1197 | - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now. | |
1198 | - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now. | |
1199 | ||
90ee1b18 | 1200 | ## [2.2.2] - 2022-10-09 |
cb2b6c69 JB |
1201 | |
1202 | ### Fixed | |
1203 | ||
1204 | - Fixed `README.md` file. | |
1205 | ||
90ee1b18 | 1206 | ## [2.2.1] - 2022-10-08 |
bdacc2d2 | 1207 | |
bdaf31cd JB |
1208 | ### Added |
1209 | ||
1210 | - Dynamic worker choice strategy change at runtime. | |
bdacc2d2 | 1211 | |
90ee1b18 | 1212 | ## [2.2.0] - 2022-01-05 |
7e0d447f JB |
1213 | |
1214 | ### Breaking Changes | |
1215 | ||
9606b474 | 1216 | - Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version. |
7e0d447f | 1217 | |
90ee1b18 | 1218 | ## [2.1.0] - 2021-08-29 |
35cf1c03 JB |
1219 | |
1220 | ### Added | |
1221 | ||
1222 | - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker. | |
e088a00c JB |
1223 | |
1224 | ### Breaking Changes | |
1225 | ||
1226 | - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute. | |
1227 | - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`. | |
1228 | - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`. | |
c365b2d3 | 1229 | - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker. |
e088a00c | 1230 | |
90ee1b18 | 1231 | ## [2.0.2] - 2021-05-12 |
14916bf9 JB |
1232 | |
1233 | ### Bug fixes | |
1234 | ||
1235 | - Fix `busy` event emission on fixed pool type | |
1236 | ||
90ee1b18 | 1237 | ## [2.0.1] - 2021-03-16 |
7f685093 JB |
1238 | |
1239 | ### Bug fixes | |
1240 | ||
1241 | - Check if pool options are properly set. | |
1242 | - `busy` event is emitted on all pool types. | |
1243 | ||
90ee1b18 | 1244 | ## [2.0.0] - 2021-03-01 |
fa0f5b28 | 1245 | |
f3f833ab | 1246 | ### Bug fixes |
d63d3be3 | 1247 | |
ddbeaffd | 1248 | - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70). |
d63d3be3 | 1249 | |
fa0f5b28 S |
1250 | ### Breaking Changes |
1251 | ||
7f685093 | 1252 | - `FullPool` event is now renamed to `busy`. |
1927ee67 | 1253 | - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`. |
1a81f8af | 1254 | _Find more details on our JSDoc._ |
ddbeaffd | 1255 | |
1927ee67 APA |
1256 | - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed. |
1257 | ||
ddbeaffd | 1258 | - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes. |
fa0f5b28 | 1259 | |
ec2ccfc8 JB |
1260 | ### Pool options types declaration merge |
1261 | ||
1262 | `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`. | |
1263 | ||
fa0f5b28 S |
1264 | #### New `export` strategy |
1265 | ||
1266 | ```js | |
1267 | // Before | |
0eee77cb | 1268 | const DynamicThreadPool = require('poolifier/lib/dynamic') |
fa0f5b28 | 1269 | // After |
0eee77cb | 1270 | const { DynamicThreadPool } = require('poolifier/lib/dynamic') |
fa0f5b28 S |
1271 | ``` |
1272 | ||
1273 | But you should always prefer just using | |
1274 | ||
1275 | ```js | |
0eee77cb | 1276 | const { DynamicThreadPool } = require('poolifier') |
fa0f5b28 S |
1277 | ``` |
1278 | ||
d3c8a1a8 S |
1279 | #### New type definitions for input data and response |
1280 | ||
6677a3d3 | 1281 | For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data. |
9606b474 | 1282 | _This is not a limitation by poolifier but Node.js._ |
d3c8a1a8 | 1283 | |
3a4b605f | 1284 | #### Public property replacements |
5c5a1fb7 | 1285 | |
3a4b605f | 1286 | `numWorkers` property is now `numberOfWorkers` |
5c5a1fb7 | 1287 | |
280c2a77 | 1288 | #### Internal (protected) properties and methods renaming |
fa0f5b28 | 1289 | |
280c2a77 S |
1290 | These properties are not intended for end users |
1291 | ||
1292 | - `id` => `nextMessageId` | |
1293 | ||
1294 | These methods are not intended for end users | |
fa0f5b28 S |
1295 | |
1296 | - `_chooseWorker` => `chooseWorker` | |
280c2a77 | 1297 | - `_newWorker` => `createWorker` |
fa0f5b28 S |
1298 | - `_execute` => `internalExecute` |
1299 | - `_chooseWorker` => `chooseWorker` | |
1300 | - `_checkAlive` => `checkAlive` | |
1301 | - `_run` => `run` | |
1302 | - `_runAsync` => `runAsync` | |
1303 | ||
90ee1b18 | 1304 | ## [1.1.0] - 2020-05-21 |
0312f71a APA |
1305 | |
1306 | ### Added | |
1307 | ||
1308 | - ThreadWorker support async functions as option | |
cf9aa6c3 | 1309 | - Various external library patches |
0312f71a | 1310 | |
90ee1b18 | 1311 | ## [1.0.0] - 2020-01-24 |
522eea03 | 1312 | |
1313 | ### Added | |
1314 | ||
1315 | - FixedThreadPool implementation | |
1316 | - DynamicThreadPool implementation | |
0312f71a | 1317 | - WorkerThread implementation to improve developer experience |