Apply dependencies update
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
45a5a54c
JB
8## [Unreleased]
9
ca6c7d70
JB
10### Changed
11
12- Switch internal benchmarking code to benny.
13
d15211d4
JB
14### Fixed
15
16- Fix random integer generator.
17
995705ea
JB
18## [2.3.7] - 2022-10-23
19
b953022b
JB
20### Changed
21
22- Switch to open collective FOSS project funding platform.
78cea37e
JB
23- Switch to ts-standard linter configuration on TypeScript code.
24
25### Fixed
26
27- Fixed missing async on pool execute method.
28- Fixed typing in TypeScript example.
29- Fixed types in unit tests.
b953022b 30
3b9f6953
JB
31## [2.3.6] - 2022-10-22
32
f80cead4
JB
33### Changed
34
35- Cleanup pool attributes and methods.
36- Refine error types thrown.
37
38### Fixed
39
40- Fix continuous integration build on windows.
41- Fix code coverage reporting by using c8 instead of nyc.
42
efc22107
JB
43## [2.3.5] - 2022-10-21
44
7a6a0a96
JB
45### Changed
46
a05c10de
JB
47- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
48- Optimize tasks usage lookup implementation.
7a6a0a96 49
b4904890
JB
50### Fixed
51
52- Fix missed pool event emitter type export.
53- Fix typedoc documentation generation.
54
a875f8d1
JB
55## [2.3.4] - 2022-10-17
56
73cda448
JB
57### Added
58
59- Fully automate release process with release-it.
60
45a5a54c
JB
61### Changed
62
73cda448 63- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 64- Update benchmarks versus external pools results with latest version.
45a5a54c 65
90ee1b18 66## [2.3.3] - 2022-10-15
1a76932b
JB
67
68### Added
69
70- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
71
90ee1b18 72## [2.3.2] - 2022-10-14
11df3590
JB
73
74### Changed
75
76- Optimize fair share worker selection strategy implementation.
77
78### Fixed
79
80- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
81
90ee1b18 82## [2.3.1] - 2022-10-13
23ff945a
JB
83
84### Added
85
86- Pool worker choice strategies:
87 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
88 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
89
90ee1b18 90## [2.2.2] - 2022-10-09
cb2b6c69
JB
91
92### Fixed
93
94- Fixed `README.md` file.
95
90ee1b18 96## [2.2.1] - 2022-10-08
bdacc2d2 97
bdaf31cd
JB
98### Added
99
100- Dynamic worker choice strategy change at runtime.
bdacc2d2 101
90ee1b18 102## [2.2.0] - 2022-01-05
7e0d447f
JB
103
104### Breaking Changes
105
106- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
107
90ee1b18 108## [2.1.0] - 2021-08-29
35cf1c03
JB
109
110### Added
111
112- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
113
114### Breaking Changes
115
116- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
117- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
118- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 119- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 120
90ee1b18 121## [2.0.2] - 2021-05-12
14916bf9
JB
122
123### Bug fixes
124
125- Fix `busy` event emission on fixed pool type
126
90ee1b18 127## [2.0.1] - 2021-03-16
7f685093
JB
128
129### Bug fixes
130
131- Check if pool options are properly set.
132- `busy` event is emitted on all pool types.
133
90ee1b18 134## [2.0.0] - 2021-03-01
fa0f5b28 135
f3f833ab 136### Bug fixes
d63d3be3 137
ddbeaffd 138- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 139
fa0f5b28
S
140### Breaking Changes
141
7f685093 142- `FullPool` event is now renamed to `busy`.
1927ee67 143- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 144 _Find more details on our JSDoc._
ddbeaffd 145
1927ee67
APA
146- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
147
ddbeaffd 148- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 149
ec2ccfc8
JB
150### Pool options types declaration merge
151
152`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
153
fa0f5b28
S
154#### New `export` strategy
155
156```js
157// Before
777b7824 158const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 159// After
777b7824 160const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
161```
162
163But you should always prefer just using
164
165```js
777b7824 166const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
167```
168
d3c8a1a8
S
169#### New type definitions for input data and response
170
ec2ccfc8 171For cluster worker and worker-thread pools, you can now only send and receive serializable data.
d3c8a1a8
S
172_This is not a limitation by poolifier but NodeJS._
173
3a4b605f 174#### Public property replacements
5c5a1fb7 175
3a4b605f 176`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 177
280c2a77 178#### Internal (protected) properties and methods renaming
fa0f5b28 179
280c2a77
S
180These properties are not intended for end users
181
182- `id` => `nextMessageId`
183
184These methods are not intended for end users
fa0f5b28
S
185
186- `_chooseWorker` => `chooseWorker`
280c2a77 187- `_newWorker` => `createWorker`
fa0f5b28
S
188- `_execute` => `internalExecute`
189- `_chooseWorker` => `chooseWorker`
190- `_checkAlive` => `checkAlive`
191- `_run` => `run`
192- `_runAsync` => `runAsync`
193
90ee1b18 194## [1.1.0] - 2020-05-21
0312f71a
APA
195
196### Added
197
198- ThreadWorker support async functions as option
cf9aa6c3 199- Various external library patches
0312f71a 200
90ee1b18 201## [1.0.0] - 2020-01-24
522eea03 202
203### Added
204
205- FixedThreadPool implementation
206- DynamicThreadPool implementation
0312f71a 207- WorkerThread implementation to improve developer experience