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