perf: only check worker status when necessary
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
45a5a54c
JB
8## [Unreleased]
9
08372738
JB
10## [2.3.10] - 2023-03-18
11
710826bc
JB
12### Fixed
13
14- Fix `exports` syntax for ESM and CommonJS.
15
16### Changed
17
18- Permit SemVer pre-release publication.
76e5ac6f 19
e4796ecd
JB
20## [2.3.10-2] - 2023-03-18
21
6abad580
JB
22### Fixed
23
24- Fix `exports` syntax for ESM and CommonJS.
25
a2ee98cc
JB
26## [2.3.10-1] - 2023-03-18
27
7e060cee
JB
28### Changed
29
90483887 30- Permit SemVer pre-release publication.
7e060cee 31
c81bfafb
JB
32## [2.3.10-0] - 2023-03-18
33
fe18768d
JB
34### Fixed
35
36- Fix `exports` syntax for ESM and CommonJS.
37
d7b78217
JB
38## [2.3.9] - 2023-03-18
39
ed6dd37f
JB
40### Changed
41
42- Introduce ESM module support along with CommonJS one.
43
44### Fixed
45
46- Fix brown paper bag bug referencing the same object literal.
47
68e2ad86
JB
48## [2.3.8] - 2023-03-18
49
ca6c7d70
JB
50### Changed
51
52- Switch internal benchmarking code to benny.
fbdedeb9
JB
53- Switch to TypeScript 5.x.x.
54- Switch rollup bundler plugins to core ones.
ed6dd37f 55- Switch to TSDoc syntax.
fbdedeb9 56- Enforce conventional commits.
ca6c7d70 57
d15211d4
JB
58### Fixed
59
60- Fix random integer generator.
fbdedeb9 61- Fix worker choice strategy pool type identification at initialization.
d15211d4 62
995705ea
JB
63## [2.3.7] - 2022-10-23
64
b953022b
JB
65### Changed
66
67- Switch to open collective FOSS project funding platform.
78cea37e
JB
68- Switch to ts-standard linter configuration on TypeScript code.
69
70### Fixed
71
72- Fixed missing async on pool execute method.
73- Fixed typing in TypeScript example.
74- Fixed types in unit tests.
b953022b 75
3b9f6953
JB
76## [2.3.6] - 2022-10-22
77
f80cead4
JB
78### Changed
79
80- Cleanup pool attributes and methods.
81- Refine error types thrown.
82
83### Fixed
84
85- Fix continuous integration build on windows.
86- Fix code coverage reporting by using c8 instead of nyc.
87
efc22107
JB
88## [2.3.5] - 2022-10-21
89
7a6a0a96
JB
90### Changed
91
a05c10de
JB
92- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
93- Optimize tasks usage lookup implementation.
7a6a0a96 94
b4904890
JB
95### Fixed
96
97- Fix missed pool event emitter type export.
98- Fix typedoc documentation generation.
99
a875f8d1
JB
100## [2.3.4] - 2022-10-17
101
73cda448
JB
102### Added
103
104- Fully automate release process with release-it.
105
45a5a54c
JB
106### Changed
107
73cda448 108- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 109- Update benchmarks versus external pools results with latest version.
45a5a54c 110
90ee1b18 111## [2.3.3] - 2022-10-15
1a76932b
JB
112
113### Added
114
115- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
116
90ee1b18 117## [2.3.2] - 2022-10-14
11df3590
JB
118
119### Changed
120
121- Optimize fair share worker selection strategy implementation.
122
123### Fixed
124
125- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
126
90ee1b18 127## [2.3.1] - 2022-10-13
23ff945a
JB
128
129### Added
130
131- Pool worker choice strategies:
132 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
133 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
134
90ee1b18 135## [2.2.2] - 2022-10-09
cb2b6c69
JB
136
137### Fixed
138
139- Fixed `README.md` file.
140
90ee1b18 141## [2.2.1] - 2022-10-08
bdacc2d2 142
bdaf31cd
JB
143### Added
144
145- Dynamic worker choice strategy change at runtime.
bdacc2d2 146
90ee1b18 147## [2.2.0] - 2022-01-05
7e0d447f
JB
148
149### Breaking Changes
150
151- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
152
90ee1b18 153## [2.1.0] - 2021-08-29
35cf1c03
JB
154
155### Added
156
157- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
158
159### Breaking Changes
160
161- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
162- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
163- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 164- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 165
90ee1b18 166## [2.0.2] - 2021-05-12
14916bf9
JB
167
168### Bug fixes
169
170- Fix `busy` event emission on fixed pool type
171
90ee1b18 172## [2.0.1] - 2021-03-16
7f685093
JB
173
174### Bug fixes
175
176- Check if pool options are properly set.
177- `busy` event is emitted on all pool types.
178
90ee1b18 179## [2.0.0] - 2021-03-01
fa0f5b28 180
f3f833ab 181### Bug fixes
d63d3be3 182
ddbeaffd 183- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 184
fa0f5b28
S
185### Breaking Changes
186
7f685093 187- `FullPool` event is now renamed to `busy`.
1927ee67 188- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 189 _Find more details on our JSDoc._
ddbeaffd 190
1927ee67
APA
191- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
192
ddbeaffd 193- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 194
ec2ccfc8
JB
195### Pool options types declaration merge
196
197`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
198
fa0f5b28
S
199#### New `export` strategy
200
201```js
202// Before
777b7824 203const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 204// After
777b7824 205const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
206```
207
208But you should always prefer just using
209
210```js
777b7824 211const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
212```
213
d3c8a1a8
S
214#### New type definitions for input data and response
215
ec2ccfc8 216For cluster worker and worker-thread pools, you can now only send and receive serializable data.
d3c8a1a8
S
217_This is not a limitation by poolifier but NodeJS._
218
3a4b605f 219#### Public property replacements
5c5a1fb7 220
3a4b605f 221`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 222
280c2a77 223#### Internal (protected) properties and methods renaming
fa0f5b28 224
280c2a77
S
225These properties are not intended for end users
226
227- `id` => `nextMessageId`
228
229These methods are not intended for end users
fa0f5b28
S
230
231- `_chooseWorker` => `chooseWorker`
280c2a77 232- `_newWorker` => `createWorker`
fa0f5b28
S
233- `_execute` => `internalExecute`
234- `_chooseWorker` => `chooseWorker`
235- `_checkAlive` => `checkAlive`
236- `_run` => `run`
237- `_runAsync` => `runAsync`
238
90ee1b18 239## [1.1.0] - 2020-05-21
0312f71a
APA
240
241### Added
242
243- ThreadWorker support async functions as option
cf9aa6c3 244- Various external library patches
0312f71a 245
90ee1b18 246## [1.0.0] - 2020-01-24
522eea03 247
248### Added
249
250- FixedThreadPool implementation
251- DynamicThreadPool implementation
0312f71a 252- WorkerThread implementation to improve developer experience