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.0.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10 ## [2.3.10-0] - 2023-03-18
14 - Fix `exports` syntax for ESM and CommonJS.
16 ## [2.3.9] - 2023-03-18
20 - Introduce ESM module support along with CommonJS one.
24 - Fix brown paper bag bug referencing the same object literal.
26 ## [2.3.8] - 2023-03-18
30 - Switch internal benchmarking code to benny.
31 - Switch to TypeScript 5.x.x.
32 - Switch rollup bundler plugins to core ones.
33 - Switch to TSDoc syntax.
34 - Enforce conventional commits.
38 - Fix random integer generator.
39 - Fix worker choice strategy pool type identification at initialization.
41 ## [2.3.7] - 2022-10-23
45 - Switch to open collective FOSS project funding platform.
46 - Switch to ts-standard linter configuration on TypeScript code.
50 - Fixed missing async on pool execute method.
51 - Fixed typing in TypeScript example.
52 - Fixed types in unit tests.
54 ## [2.3.6] - 2022-10-22
58 - Cleanup pool attributes and methods.
59 - Refine error types thrown.
63 - Fix continuous integration build on windows.
64 - Fix code coverage reporting by using c8 instead of nyc.
66 ## [2.3.5] - 2022-10-21
70 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
71 - Optimize tasks usage lookup implementation.
75 - Fix missed pool event emitter type export.
76 - Fix typedoc documentation generation.
78 ## [2.3.4] - 2022-10-17
82 - Fully automate release process with release-it.
86 - Optimize fair share task scheduling algorithm implementation.
87 - Update benchmarks versus external pools results with latest version.
89 ## [2.3.3] - 2022-10-15
93 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
95 ## [2.3.2] - 2022-10-14
99 - Optimize fair share worker selection strategy implementation.
103 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
105 ## [2.3.1] - 2022-10-13
109 - Pool worker choice strategies:
110 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
111 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
113 ## [2.2.2] - 2022-10-09
117 - Fixed `README.md` file.
119 ## [2.2.1] - 2022-10-08
123 - Dynamic worker choice strategy change at runtime.
125 ## [2.2.0] - 2022-01-05
129 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
131 ## [2.1.0] - 2021-08-29
135 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
139 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
140 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
141 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
142 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
144 ## [2.0.2] - 2021-05-12
148 - Fix `busy` event emission on fixed pool type
150 ## [2.0.1] - 2021-03-16
154 - Check if pool options are properly set.
155 - `busy` event is emitted on all pool types.
157 ## [2.0.0] - 2021-03-01
161 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
165 - `FullPool` event is now renamed to `busy`.
166 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
167 _Find more details on our JSDoc._
169 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
171 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
173 ### Pool options types declaration merge
175 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
177 #### New `export` strategy
181 const DynamicThreadPool = require('poolifier/lib/dynamic')
183 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
186 But you should always prefer just using
189 const { DynamicThreadPool } = require('poolifier')
192 #### New type definitions for input data and response
194 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
195 _This is not a limitation by poolifier but NodeJS._
197 #### Public property replacements
199 `numWorkers` property is now `numberOfWorkers`
201 #### Internal (protected) properties and methods renaming
203 These properties are not intended for end users
205 - `id` => `nextMessageId`
207 These methods are not intended for end users
209 - `_chooseWorker` => `chooseWorker`
210 - `_newWorker` => `createWorker`
211 - `_execute` => `internalExecute`
212 - `_chooseWorker` => `chooseWorker`
213 - `_checkAlive` => `checkAlive`
215 - `_runAsync` => `runAsync`
217 ## [1.1.0] - 2020-05-21
221 - ThreadWorker support async functions as option
222 - Various external library patches
224 ## [1.0.0] - 2020-01-24
228 - FixedThreadPool implementation
229 - DynamicThreadPool implementation
230 - WorkerThread implementation to improve developer experience