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