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