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