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