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