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