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