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