chore: generate documentation
[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.1.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8## [Unreleased]
9
10### Added
11
12- Add `LESS_BUSY` worker choice strategy.
13
14### Changed
15
16- Optimize worker storage in pool.
17- Optimize worker alive status check.
18- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
19- Optimize `LESS_USED` worker choice strategy.
20- Update benchmarks versus external threads pools.
21
22### Fixed
23
24- Ensure trimmable characters are checked at pool initialization.
25- Fix message id integer overflow.
26- Fix pool worker removal in worker choice strategy internals.
27- Fix package publication with pnpm.
28
29## [2.4.0-2] - 2023-04-03
30
31### Added
32
33- Add `LESS_BUSY` worker choice strategy.
34
35### Changed
36
37- Optimize worker storage in pool.
38- Optimize worker alive status check.
39- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
40- Optimize `LESS_USED` worker choice strategy.
41
42### Fixed
43
44- Ensure trimmable characters are checked at pool initialization.
45- Fix message id integer overflow.
46- Fix pool worker removal in worker choice strategy internals.
47- Fix package publication with pnpm.
48
49## [2.4.0-1] - 2023-04-03
50
51### Added
52
53- Add `LESS_BUSY` worker choice strategy.
54
55### Changed
56
57- Optimize worker storage in pool.
58- Optimize worker alive status check.
59- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
60- Optimize `LESS_USED` worker choice strategy.
61
62### Fixed
63
64- Ensure trimmable characters are checked at pool initialization.
65- Fix message id integer overflow.
66- Fix pool worker removal in worker choice strategy internals.
67
68## [2.4.0-0] - 2023-04-03
69
70### Added
71
72- Add `LESS_BUSY` worker choice strategy.
73
74### Changed
75
76- Optimize worker storage in pool.
77- Optimize worker alive status check.
78- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
79- Optimize `LESS_USED` worker choice strategy.
80
81### Fixed
82
83- Ensure trimmable characters are checked at pool initialization.
84- Fix message id integer overflow.
85- Fix pool worker removal in worker choice strategy internals.
86
87## [2.3.10] - 2023-03-18
88
89### Fixed
90
91- Fix `exports` syntax for ESM and CommonJS.
92
93### Changed
94
95- Permit SemVer pre-release publication.
96
97## [2.3.10-2] - 2023-03-18
98
99### Fixed
100
101- Fix `exports` syntax for ESM and CommonJS.
102
103## [2.3.10-1] - 2023-03-18
104
105### Changed
106
107- Permit SemVer pre-release publication.
108
109## [2.3.10-0] - 2023-03-18
110
111### Fixed
112
113- Fix `exports` syntax for ESM and CommonJS.
114
115## [2.3.9] - 2023-03-18
116
117### Changed
118
119- Introduce ESM module support along with CommonJS one.
120
121### Fixed
122
123- Fix brown paper bag bug referencing the same object literal.
124
125## [2.3.8] - 2023-03-18
126
127### Changed
128
129- Switch internal benchmarking code to benny.
130- Switch to TypeScript 5.x.x.
131- Switch rollup bundler plugins to core ones.
132- Switch to TSDoc syntax.
133- Enforce conventional commits.
134
135### Fixed
136
137- Fix random integer generator.
138- Fix worker choice strategy pool type identification at initialization.
139
140## [2.3.7] - 2022-10-23
141
142### Changed
143
144- Switch to open collective FOSS project funding platform.
145- Switch to ts-standard linter configuration on TypeScript code.
146
147### Fixed
148
149- Fixed missing async on pool execute method.
150- Fixed typing in TypeScript example.
151- Fixed types in unit tests.
152
153## [2.3.6] - 2022-10-22
154
155### Changed
156
157- Cleanup pool attributes and methods.
158- Refine error types thrown.
159
160### Fixed
161
162- Fix continuous integration build on windows.
163- Fix code coverage reporting by using c8 instead of nyc.
164
165## [2.3.5] - 2022-10-21
166
167### Changed
168
169- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
170- Optimize tasks usage lookup implementation.
171
172### Fixed
173
174- Fix missed pool event emitter type export.
175- Fix typedoc documentation generation.
176
177## [2.3.4] - 2022-10-17
178
179### Added
180
181- Fully automate release process with release-it.
182
183### Changed
184
185- Optimize fair share task scheduling algorithm implementation.
186- Update benchmarks versus external pools results with latest version.
187
188## [2.3.3] - 2022-10-15
189
190### Added
191
192- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
193
194## [2.3.2] - 2022-10-14
195
196### Changed
197
198- Optimize fair share worker selection strategy implementation.
199
200### Fixed
201
202- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
203
204## [2.3.1] - 2022-10-13
205
206### Added
207
208- Pool worker choice strategies:
209 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
210 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
211
212## [2.2.2] - 2022-10-09
213
214### Fixed
215
216- Fixed `README.md` file.
217
218## [2.2.1] - 2022-10-08
219
220### Added
221
222- Dynamic worker choice strategy change at runtime.
223
224## [2.2.0] - 2022-01-05
225
226### Breaking Changes
227
228- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
229
230## [2.1.0] - 2021-08-29
231
232### Added
233
234- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
235
236### Breaking Changes
237
238- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
239- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
240- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
241- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
242
243## [2.0.2] - 2021-05-12
244
245### Bug fixes
246
247- Fix `busy` event emission on fixed pool type
248
249## [2.0.1] - 2021-03-16
250
251### Bug fixes
252
253- Check if pool options are properly set.
254- `busy` event is emitted on all pool types.
255
256## [2.0.0] - 2021-03-01
257
258### Bug fixes
259
260- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
261
262### Breaking Changes
263
264- `FullPool` event is now renamed to `busy`.
265- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
266 _Find more details on our JSDoc._
267
268- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
269
270- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
271
272### Pool options types declaration merge
273
274`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
275
276#### New `export` strategy
277
278```js
279// Before
280const DynamicThreadPool = require('poolifier/lib/dynamic')
281// After
282const { DynamicThreadPool } = require('poolifier/lib/dynamic')
283```
284
285But you should always prefer just using
286
287```js
288const { DynamicThreadPool } = require('poolifier')
289```
290
291#### New type definitions for input data and response
292
293For cluster worker and worker-thread pools, you can now only send and receive serializable data.
294_This is not a limitation by poolifier but NodeJS._
295
296#### Public property replacements
297
298`numWorkers` property is now `numberOfWorkers`
299
300#### Internal (protected) properties and methods renaming
301
302These properties are not intended for end users
303
304- `id` => `nextMessageId`
305
306These methods are not intended for end users
307
308- `_chooseWorker` => `chooseWorker`
309- `_newWorker` => `createWorker`
310- `_execute` => `internalExecute`
311- `_chooseWorker` => `chooseWorker`
312- `_checkAlive` => `checkAlive`
313- `_run` => `run`
314- `_runAsync` => `runAsync`
315
316## [1.1.0] - 2020-05-21
317
318### Added
319
320- ThreadWorker support async functions as option
321- Various external library patches
322
323## [1.0.0] - 2020-01-24
324
325### Added
326
327- FixedThreadPool implementation
328- DynamicThreadPool implementation
329- WorkerThread implementation to improve developer experience