build: permit SemVer pre-release publication
[poolifier.git] / CHANGELOG.md
... / ...
CommitLineData
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
8## [Unreleased]
9
10## [2.3.10-0] - 2023-03-18
11
12### Fixed
13
14- Fix `exports` syntax for ESM and CommonJS.
15
16## [2.3.9] - 2023-03-18
17
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
26## [2.3.8] - 2023-03-18
27
28### Changed
29
30- Switch internal benchmarking code to benny.
31- Switch to TypeScript 5.x.x.
32- Switch rollup bundler plugins to core ones.
33- Switch to TSDoc syntax.
34- Enforce conventional commits.
35
36### Fixed
37
38- Fix random integer generator.
39- Fix worker choice strategy pool type identification at initialization.
40
41## [2.3.7] - 2022-10-23
42
43### Changed
44
45- Switch to open collective FOSS project funding platform.
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.
53
54## [2.3.6] - 2022-10-22
55
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
66## [2.3.5] - 2022-10-21
67
68### Changed
69
70- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
71- Optimize tasks usage lookup implementation.
72
73### Fixed
74
75- Fix missed pool event emitter type export.
76- Fix typedoc documentation generation.
77
78## [2.3.4] - 2022-10-17
79
80### Added
81
82- Fully automate release process with release-it.
83
84### Changed
85
86- Optimize fair share task scheduling algorithm implementation.
87- Update benchmarks versus external pools results with latest version.
88
89## [2.3.3] - 2022-10-15
90
91### Added
92
93- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
94
95## [2.3.2] - 2022-10-14
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
105## [2.3.1] - 2022-10-13
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
113## [2.2.2] - 2022-10-09
114
115### Fixed
116
117- Fixed `README.md` file.
118
119## [2.2.1] - 2022-10-08
120
121### Added
122
123- Dynamic worker choice strategy change at runtime.
124
125## [2.2.0] - 2022-01-05
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
131## [2.1.0] - 2021-08-29
132
133### Added
134
135- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
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`.
142- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
143
144## [2.0.2] - 2021-05-12
145
146### Bug fixes
147
148- Fix `busy` event emission on fixed pool type
149
150## [2.0.1] - 2021-03-16
151
152### Bug fixes
153
154- Check if pool options are properly set.
155- `busy` event is emitted on all pool types.
156
157## [2.0.0] - 2021-03-01
158
159### Bug fixes
160
161- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
162
163### Breaking Changes
164
165- `FullPool` event is now renamed to `busy`.
166- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
167 _Find more details on our JSDoc._
168
169- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
170
171- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
172
173### Pool options types declaration merge
174
175`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
176
177#### New `export` strategy
178
179```js
180// Before
181const DynamicThreadPool = require('poolifier/lib/dynamic')
182// After
183const { DynamicThreadPool } = require('poolifier/lib/dynamic')
184```
185
186But you should always prefer just using
187
188```js
189const { DynamicThreadPool } = require('poolifier')
190```
191
192#### New type definitions for input data and response
193
194For cluster worker and worker-thread pools, you can now only send and receive serializable data.
195_This is not a limitation by poolifier but NodeJS._
196
197#### Public property replacements
198
199`numWorkers` property is now `numberOfWorkers`
200
201#### Internal (protected) properties and methods renaming
202
203These properties are not intended for end users
204
205- `id` => `nextMessageId`
206
207These methods are not intended for end users
208
209- `_chooseWorker` => `chooseWorker`
210- `_newWorker` => `createWorker`
211- `_execute` => `internalExecute`
212- `_chooseWorker` => `chooseWorker`
213- `_checkAlive` => `checkAlive`
214- `_run` => `run`
215- `_runAsync` => `runAsync`
216
217## [1.1.0] - 2020-05-21
218
219### Added
220
221- ThreadWorker support async functions as option
222- Various external library patches
223
224## [1.0.0] - 2020-01-24
225
226### Added
227
228- FixedThreadPool implementation
229- DynamicThreadPool implementation
230- WorkerThread implementation to improve developer experience