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