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