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