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