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