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