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