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