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