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).
12 - Switch internal benchmarking code to benny.
16 - Fix random integer generator.
18 ## [2.3.7] - 2022-10-23
22 - Switch to open collective FOSS project funding platform.
23 - Switch to ts-standard linter configuration on TypeScript code.
27 - Fixed missing async on pool execute method.
28 - Fixed typing in TypeScript example.
29 - Fixed types in unit tests.
31 ## [2.3.6] - 2022-10-22
35 - Cleanup pool attributes and methods.
36 - Refine error types thrown.
40 - Fix continuous integration build on windows.
41 - Fix code coverage reporting by using c8 instead of nyc.
43 ## [2.3.5] - 2022-10-21
47 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
48 - Optimize tasks usage lookup implementation.
52 - Fix missed pool event emitter type export.
53 - Fix typedoc documentation generation.
55 ## [2.3.4] - 2022-10-17
59 - Fully automate release process with release-it.
63 - Optimize fair share task scheduling algorithm implementation.
64 - Update benchmarks versus external pools results with latest version.
66 ## [2.3.3] - 2022-10-15
70 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
72 ## [2.3.2] - 2022-10-14
76 - Optimize fair share worker selection strategy implementation.
80 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
82 ## [2.3.1] - 2022-10-13
86 - Pool worker choice strategies:
87 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
88 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
90 ## [2.2.2] - 2022-10-09
94 - Fixed `README.md` file.
96 ## [2.2.1] - 2022-10-08
100 - Dynamic worker choice strategy change at runtime.
102 ## [2.2.0] - 2022-01-05
106 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
108 ## [2.1.0] - 2021-08-29
112 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
116 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
117 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
118 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
119 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
121 ## [2.0.2] - 2021-05-12
125 - Fix `busy` event emission on fixed pool type
127 ## [2.0.1] - 2021-03-16
131 - Check if pool options are properly set.
132 - `busy` event is emitted on all pool types.
134 ## [2.0.0] - 2021-03-01
138 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
142 - `FullPool` event is now renamed to `busy`.
143 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
144 _Find more details on our JSDoc._
146 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
148 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
150 ### Pool options types declaration merge
152 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
154 #### New `export` strategy
158 const DynamicThreadPool = require('poolifier/lib/dynamic')
160 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
163 But you should always prefer just using
166 const { DynamicThreadPool } = require('poolifier')
169 #### New type definitions for input data and response
171 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
172 _This is not a limitation by poolifier but NodeJS._
174 #### Public property replacements
176 `numWorkers` property is now `numberOfWorkers`
178 #### Internal (protected) properties and methods renaming
180 These properties are not intended for end users
182 - `id` => `nextMessageId`
184 These methods are not intended for end users
186 - `_chooseWorker` => `chooseWorker`
187 - `_newWorker` => `createWorker`
188 - `_execute` => `internalExecute`
189 - `_chooseWorker` => `chooseWorker`
190 - `_checkAlive` => `checkAlive`
192 - `_runAsync` => `runAsync`
194 ## [1.1.0] - 2020-05-21
198 - ThreadWorker support async functions as option
199 - Various external library patches
201 ## [1.0.0] - 2020-01-24
205 - FixedThreadPool implementation
206 - DynamicThreadPool implementation
207 - WorkerThread implementation to improve developer experience