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