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