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