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