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