3 All notable changes to this project will be documented in this file.
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10 ## [2.4.0] - 2023-04-04
14 - Add `LESS_BUSY` worker choice strategy.
18 - Optimize worker storage in pool.
19 - Optimize worker alive status check.
20 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
21 - Optimize `LESS_USED` worker choice strategy.
22 - Update benchmarks versus external threads pools.
23 - Optimize tasks usage statistics requirements for worker choice strategy.
27 - Ensure trimmable characters are checked at pool initialization.
28 - Fix message id integer overflow.
29 - Fix pool worker removal in worker choice strategy internals.
30 - Fix package publication with pnpm.
32 ## [2.4.0-3] - 2023-04-04
36 - Add `LESS_BUSY` worker choice strategy.
40 - Optimize worker storage in pool.
41 - Optimize worker alive status check.
42 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
43 - Optimize `LESS_USED` worker choice strategy.
44 - Update benchmarks versus external threads pools.
48 - Ensure trimmable characters are checked at pool initialization.
49 - Fix message id integer overflow.
50 - Fix pool worker removal in worker choice strategy internals.
51 - Fix package publication with pnpm.
53 ## [2.4.0-2] - 2023-04-03
57 - Add `LESS_BUSY` worker choice strategy.
61 - Optimize worker storage in pool.
62 - Optimize worker alive status check.
63 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
64 - Optimize `LESS_USED` worker choice strategy.
68 - Ensure trimmable characters are checked at pool initialization.
69 - Fix message id integer overflow.
70 - Fix pool worker removal in worker choice strategy internals.
71 - Fix package publication with pnpm.
73 ## [2.4.0-1] - 2023-04-03
77 - Add `LESS_BUSY` worker choice strategy.
81 - Optimize worker storage in pool.
82 - Optimize worker alive status check.
83 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
84 - Optimize `LESS_USED` worker choice strategy.
88 - Ensure trimmable characters are checked at pool initialization.
89 - Fix message id integer overflow.
90 - Fix pool worker removal in worker choice strategy internals.
92 ## [2.4.0-0] - 2023-04-03
96 - Add `LESS_BUSY` worker choice strategy.
100 - Optimize worker storage in pool.
101 - Optimize worker alive status check.
102 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
103 - Optimize `LESS_USED` worker choice strategy.
107 - Ensure trimmable characters are checked at pool initialization.
108 - Fix message id integer overflow.
109 - Fix pool worker removal in worker choice strategy internals.
111 ## [2.3.10] - 2023-03-18
115 - Fix `exports` syntax for ESM and CommonJS.
119 - Permit SemVer pre-release publication.
121 ## [2.3.10-2] - 2023-03-18
125 - Fix `exports` syntax for ESM and CommonJS.
127 ## [2.3.10-1] - 2023-03-18
131 - Permit SemVer pre-release publication.
133 ## [2.3.10-0] - 2023-03-18
137 - Fix `exports` syntax for ESM and CommonJS.
139 ## [2.3.9] - 2023-03-18
143 - Introduce ESM module support along with CommonJS one.
147 - Fix brown paper bag bug referencing the same object literal.
149 ## [2.3.8] - 2023-03-18
153 - Switch internal benchmarking code to benny.
154 - Switch to TypeScript 5.x.x.
155 - Switch rollup bundler plugins to core ones.
156 - Switch to TSDoc syntax.
157 - Enforce conventional commits.
161 - Fix random integer generator.
162 - Fix worker choice strategy pool type identification at initialization.
164 ## [2.3.7] - 2022-10-23
168 - Switch to open collective FOSS project funding platform.
169 - Switch to ts-standard linter configuration on TypeScript code.
173 - Fixed missing async on pool execute method.
174 - Fixed typing in TypeScript example.
175 - Fixed types in unit tests.
177 ## [2.3.6] - 2022-10-22
181 - Cleanup pool attributes and methods.
182 - Refine error types thrown.
186 - Fix continuous integration build on windows.
187 - Fix code coverage reporting by using c8 instead of nyc.
189 ## [2.3.5] - 2022-10-21
193 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
194 - Optimize tasks usage lookup implementation.
198 - Fix missed pool event emitter type export.
199 - Fix typedoc documentation generation.
201 ## [2.3.4] - 2022-10-17
205 - Fully automate release process with release-it.
209 - Optimize fair share task scheduling algorithm implementation.
210 - Update benchmarks versus external pools results with latest version.
212 ## [2.3.3] - 2022-10-15
216 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
218 ## [2.3.2] - 2022-10-14
222 - Optimize fair share worker selection strategy implementation.
226 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
228 ## [2.3.1] - 2022-10-13
232 - Pool worker choice strategies:
233 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
234 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
236 ## [2.2.2] - 2022-10-09
240 - Fixed `README.md` file.
242 ## [2.2.1] - 2022-10-08
246 - Dynamic worker choice strategy change at runtime.
248 ## [2.2.0] - 2022-01-05
252 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
254 ## [2.1.0] - 2021-08-29
258 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
262 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
263 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
264 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
265 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
267 ## [2.0.2] - 2021-05-12
271 - Fix `busy` event emission on fixed pool type
273 ## [2.0.1] - 2021-03-16
277 - Check if pool options are properly set.
278 - `busy` event is emitted on all pool types.
280 ## [2.0.0] - 2021-03-01
284 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
288 - `FullPool` event is now renamed to `busy`.
289 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
290 _Find more details on our JSDoc._
292 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
294 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
296 ### Pool options types declaration merge
298 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
300 #### New `export` strategy
304 const DynamicThreadPool = require('poolifier/lib/dynamic')
306 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
309 But you should always prefer just using
312 const { DynamicThreadPool } = require('poolifier')
315 #### New type definitions for input data and response
317 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
318 _This is not a limitation by poolifier but NodeJS._
320 #### Public property replacements
322 `numWorkers` property is now `numberOfWorkers`
324 #### Internal (protected) properties and methods renaming
326 These properties are not intended for end users
328 - `id` => `nextMessageId`
330 These methods are not intended for end users
332 - `_chooseWorker` => `chooseWorker`
333 - `_newWorker` => `createWorker`
334 - `_execute` => `internalExecute`
335 - `_chooseWorker` => `chooseWorker`
336 - `_checkAlive` => `checkAlive`
338 - `_runAsync` => `runAsync`
340 ## [1.1.0] - 2020-05-21
344 - ThreadWorker support async functions as option
345 - Various external library patches
347 ## [1.0.0] - 2020-01-24
351 - FixedThreadPool implementation
352 - DynamicThreadPool implementation
353 - WorkerThread implementation to improve developer experience