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