chore: generate documentation
[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
aee46736
JB
10### Added
11
12- Add `PoolEvents` enumeration and `PoolEvent` type.
13
36b5e78f
JB
14### Fixed
15
aee46736 16- fix: destroy worker only on alive check.
36b5e78f 17
9fb0f324
JB
18## [2.4.3] - 2023-04-07
19
28cf3617
JB
20### Fixed
21
22- Fix typedoc generation with inheritance.
23
848f0f27
JB
24## [2.4.2] - 2023-04-06
25
164d950a
JB
26### Added
27
28- Add `full` event to dynamic pool.
32417142 29- Keep worker choice strategy in memory for conditional reuse.
164d950a 30
78ab2555
JB
31### Fixed
32
33- Fix possible negative worker key at worker removal in worker choice strategies.
34
79aafe9f
JB
35## [2.4.1] - 2023-04-05
36
9cd39dd4
JB
37### Changed
38
39- Optimize worker choice strategy for dynamic pool.
40
965415bb
JB
41### Fixed
42
43- Ensure dynamic pool does not alter worker choice strategy expected behavior.
44
d8b60b1c
JB
45## [2.4.0] - 2023-04-04
46
c6bd2650
JB
47### Added
48
49- Add `LESS_BUSY` worker choice strategy.
50
51### Changed
52
53- Optimize worker storage in pool.
54- Optimize worker alive status check.
55- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
56- Optimize `LESS_USED` worker choice strategy.
57- Update benchmarks versus external threads pools.
58- Optimize tasks usage statistics requirements for worker choice strategy.
59
60### Fixed
61
62- Ensure trimmable characters are checked at pool initialization.
63- Fix message id integer overflow.
64- Fix pool worker removal in worker choice strategy internals.
65- Fix package publication with pnpm.
66
d0a3f018
JB
67## [2.4.0-3] - 2023-04-04
68
b2ede285
JB
69### Added
70
71- Add `LESS_BUSY` worker choice strategy.
72
73### Changed
74
75- Optimize worker storage in pool.
76- Optimize worker alive status check.
77- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
78- Optimize `LESS_USED` worker choice strategy.
79- Update benchmarks versus external threads pools.
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- Fix package publication with pnpm.
87
a015ea40
JB
88## [2.4.0-2] - 2023-04-03
89
698f4bbc
JB
90### Added
91
92- Add `LESS_BUSY` worker choice strategy.
93
94### Changed
95
96- Optimize worker storage in pool.
97- Optimize worker alive status check.
98- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
99- Optimize `LESS_USED` worker choice strategy.
100
101### Fixed
102
103- Ensure trimmable characters are checked at pool initialization.
104- Fix message id integer overflow.
105- Fix pool worker removal in worker choice strategy internals.
106- Fix package publication with pnpm.
107
8fe15920
JB
108## [2.4.0-1] - 2023-04-03
109
5b301c28
JB
110### Added
111
112- Add `LESS_BUSY` worker choice strategy.
113
114### Changed
115
116- Optimize worker storage in pool.
117- Optimize worker alive status check.
118- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
119- Optimize `LESS_USED` worker choice strategy.
120
121### Fixed
122
123- Ensure trimmable characters are checked at pool initialization.
124- Fix message id integer overflow.
125- Fix pool worker removal in worker choice strategy internals.
126
2fb9ca9c
JB
127## [2.4.0-0] - 2023-04-03
128
168c526f
JB
129### Added
130
131- Add `LESS_BUSY` worker choice strategy.
132
1d71a908
JB
133### Changed
134
ffcbbad8 135- Optimize worker storage in pool.
1d71a908 136- Optimize worker alive status check.
65a60b3b 137- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
737c6d97 138- Optimize `LESS_USED` worker choice strategy.
1d71a908 139
ffcbbad8
JB
140### Fixed
141
142- Ensure trimmable characters are checked at pool initialization.
b4e75778 143- Fix message id integer overflow.
97a2abc3 144- Fix pool worker removal in worker choice strategy internals.
ffcbbad8 145
08372738
JB
146## [2.3.10] - 2023-03-18
147
710826bc
JB
148### Fixed
149
150- Fix `exports` syntax for ESM and CommonJS.
151
152### Changed
153
154- Permit SemVer pre-release publication.
76e5ac6f 155
e4796ecd
JB
156## [2.3.10-2] - 2023-03-18
157
6abad580
JB
158### Fixed
159
160- Fix `exports` syntax for ESM and CommonJS.
161
a2ee98cc
JB
162## [2.3.10-1] - 2023-03-18
163
7e060cee
JB
164### Changed
165
90483887 166- Permit SemVer pre-release publication.
7e060cee 167
c81bfafb
JB
168## [2.3.10-0] - 2023-03-18
169
fe18768d
JB
170### Fixed
171
172- Fix `exports` syntax for ESM and CommonJS.
173
d7b78217
JB
174## [2.3.9] - 2023-03-18
175
ed6dd37f
JB
176### Changed
177
178- Introduce ESM module support along with CommonJS one.
179
180### Fixed
181
182- Fix brown paper bag bug referencing the same object literal.
183
68e2ad86
JB
184## [2.3.8] - 2023-03-18
185
ca6c7d70
JB
186### Changed
187
188- Switch internal benchmarking code to benny.
fbdedeb9
JB
189- Switch to TypeScript 5.x.x.
190- Switch rollup bundler plugins to core ones.
ed6dd37f 191- Switch to TSDoc syntax.
fbdedeb9 192- Enforce conventional commits.
ca6c7d70 193
d15211d4
JB
194### Fixed
195
196- Fix random integer generator.
fbdedeb9 197- Fix worker choice strategy pool type identification at initialization.
d15211d4 198
995705ea
JB
199## [2.3.7] - 2022-10-23
200
b953022b
JB
201### Changed
202
203- Switch to open collective FOSS project funding platform.
78cea37e
JB
204- Switch to ts-standard linter configuration on TypeScript code.
205
206### Fixed
207
208- Fixed missing async on pool execute method.
209- Fixed typing in TypeScript example.
210- Fixed types in unit tests.
b953022b 211
3b9f6953
JB
212## [2.3.6] - 2022-10-22
213
f80cead4
JB
214### Changed
215
216- Cleanup pool attributes and methods.
217- Refine error types thrown.
218
219### Fixed
220
221- Fix continuous integration build on windows.
222- Fix code coverage reporting by using c8 instead of nyc.
223
efc22107
JB
224## [2.3.5] - 2022-10-21
225
7a6a0a96
JB
226### Changed
227
a05c10de
JB
228- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
229- Optimize tasks usage lookup implementation.
7a6a0a96 230
b4904890
JB
231### Fixed
232
233- Fix missed pool event emitter type export.
234- Fix typedoc documentation generation.
235
a875f8d1
JB
236## [2.3.4] - 2022-10-17
237
73cda448
JB
238### Added
239
240- Fully automate release process with release-it.
241
45a5a54c
JB
242### Changed
243
73cda448 244- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 245- Update benchmarks versus external pools results with latest version.
45a5a54c 246
90ee1b18 247## [2.3.3] - 2022-10-15
1a76932b
JB
248
249### Added
250
251- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
252
90ee1b18 253## [2.3.2] - 2022-10-14
11df3590
JB
254
255### Changed
256
257- Optimize fair share worker selection strategy implementation.
258
259### Fixed
260
261- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
262
90ee1b18 263## [2.3.1] - 2022-10-13
23ff945a
JB
264
265### Added
266
267- Pool worker choice strategies:
268 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
269 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
270
90ee1b18 271## [2.2.2] - 2022-10-09
cb2b6c69
JB
272
273### Fixed
274
275- Fixed `README.md` file.
276
90ee1b18 277## [2.2.1] - 2022-10-08
bdacc2d2 278
bdaf31cd
JB
279### Added
280
281- Dynamic worker choice strategy change at runtime.
bdacc2d2 282
90ee1b18 283## [2.2.0] - 2022-01-05
7e0d447f
JB
284
285### Breaking Changes
286
287- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
288
90ee1b18 289## [2.1.0] - 2021-08-29
35cf1c03
JB
290
291### Added
292
293- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
294
295### Breaking Changes
296
297- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
298- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
299- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 300- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 301
90ee1b18 302## [2.0.2] - 2021-05-12
14916bf9
JB
303
304### Bug fixes
305
306- Fix `busy` event emission on fixed pool type
307
90ee1b18 308## [2.0.1] - 2021-03-16
7f685093
JB
309
310### Bug fixes
311
312- Check if pool options are properly set.
313- `busy` event is emitted on all pool types.
314
90ee1b18 315## [2.0.0] - 2021-03-01
fa0f5b28 316
f3f833ab 317### Bug fixes
d63d3be3 318
ddbeaffd 319- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 320
fa0f5b28
S
321### Breaking Changes
322
7f685093 323- `FullPool` event is now renamed to `busy`.
1927ee67 324- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 325 _Find more details on our JSDoc._
ddbeaffd 326
1927ee67
APA
327- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
328
ddbeaffd 329- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 330
ec2ccfc8
JB
331### Pool options types declaration merge
332
333`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
334
fa0f5b28
S
335#### New `export` strategy
336
337```js
338// Before
777b7824 339const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 340// After
777b7824 341const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
342```
343
344But you should always prefer just using
345
346```js
777b7824 347const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
348```
349
d3c8a1a8
S
350#### New type definitions for input data and response
351
ec2ccfc8 352For cluster worker and worker-thread pools, you can now only send and receive serializable data.
d3c8a1a8
S
353_This is not a limitation by poolifier but NodeJS._
354
3a4b605f 355#### Public property replacements
5c5a1fb7 356
3a4b605f 357`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 358
280c2a77 359#### Internal (protected) properties and methods renaming
fa0f5b28 360
280c2a77
S
361These properties are not intended for end users
362
363- `id` => `nextMessageId`
364
365These methods are not intended for end users
fa0f5b28
S
366
367- `_chooseWorker` => `chooseWorker`
280c2a77 368- `_newWorker` => `createWorker`
fa0f5b28
S
369- `_execute` => `internalExecute`
370- `_chooseWorker` => `chooseWorker`
371- `_checkAlive` => `checkAlive`
372- `_run` => `run`
373- `_runAsync` => `runAsync`
374
90ee1b18 375## [1.1.0] - 2020-05-21
0312f71a
APA
376
377### Added
378
379- ThreadWorker support async functions as option
cf9aa6c3 380- Various external library patches
0312f71a 381
90ee1b18 382## [1.0.0] - 2020-01-24
522eea03 383
384### Added
385
386- FixedThreadPool implementation
387- DynamicThreadPool implementation
0312f71a 388- WorkerThread implementation to improve developer experience