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