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