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.2] - 2023-04-06
14 - Add `full` event to dynamic pool.
15 - Keep worker choice strategy in memory for conditional reuse.
19 - Fix possible negative worker key at worker removal in worker choice strategies.
21 ## [2.4.1] - 2023-04-05
25 - Optimize worker choice strategy for dynamic pool.
29 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
31 ## [2.4.0] - 2023-04-04
35 - Add `LESS_BUSY` worker choice strategy.
39 - Optimize worker storage in pool.
40 - Optimize worker alive status check.
41 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
42 - Optimize `LESS_USED` worker choice strategy.
43 - Update benchmarks versus external threads pools.
44 - Optimize tasks usage statistics requirements for worker choice strategy.
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-3] - 2023-04-04
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.
65 - Update benchmarks versus external threads pools.
69 - Ensure trimmable characters are checked at pool initialization.
70 - Fix message id integer overflow.
71 - Fix pool worker removal in worker choice strategy internals.
72 - Fix package publication with pnpm.
74 ## [2.4.0-2] - 2023-04-03
78 - Add `LESS_BUSY` worker choice strategy.
82 - Optimize worker storage in pool.
83 - Optimize worker alive status check.
84 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
85 - Optimize `LESS_USED` worker choice strategy.
89 - Ensure trimmable characters are checked at pool initialization.
90 - Fix message id integer overflow.
91 - Fix pool worker removal in worker choice strategy internals.
92 - Fix package publication with pnpm.
94 ## [2.4.0-1] - 2023-04-03
98 - Add `LESS_BUSY` worker choice strategy.
102 - Optimize worker storage in pool.
103 - Optimize worker alive status check.
104 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
105 - Optimize `LESS_USED` worker choice strategy.
109 - Ensure trimmable characters are checked at pool initialization.
110 - Fix message id integer overflow.
111 - Fix pool worker removal in worker choice strategy internals.
113 ## [2.4.0-0] - 2023-04-03
117 - Add `LESS_BUSY` worker choice strategy.
121 - Optimize worker storage in pool.
122 - Optimize worker alive status check.
123 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
124 - Optimize `LESS_USED` worker choice strategy.
128 - Ensure trimmable characters are checked at pool initialization.
129 - Fix message id integer overflow.
130 - Fix pool worker removal in worker choice strategy internals.
132 ## [2.3.10] - 2023-03-18
136 - Fix `exports` syntax for ESM and CommonJS.
140 - Permit SemVer pre-release publication.
142 ## [2.3.10-2] - 2023-03-18
146 - Fix `exports` syntax for ESM and CommonJS.
148 ## [2.3.10-1] - 2023-03-18
152 - Permit SemVer pre-release publication.
154 ## [2.3.10-0] - 2023-03-18
158 - Fix `exports` syntax for ESM and CommonJS.
160 ## [2.3.9] - 2023-03-18
164 - Introduce ESM module support along with CommonJS one.
168 - Fix brown paper bag bug referencing the same object literal.
170 ## [2.3.8] - 2023-03-18
174 - Switch internal benchmarking code to benny.
175 - Switch to TypeScript 5.x.x.
176 - Switch rollup bundler plugins to core ones.
177 - Switch to TSDoc syntax.
178 - Enforce conventional commits.
182 - Fix random integer generator.
183 - Fix worker choice strategy pool type identification at initialization.
185 ## [2.3.7] - 2022-10-23
189 - Switch to open collective FOSS project funding platform.
190 - Switch to ts-standard linter configuration on TypeScript code.
194 - Fixed missing async on pool execute method.
195 - Fixed typing in TypeScript example.
196 - Fixed types in unit tests.
198 ## [2.3.6] - 2022-10-22
202 - Cleanup pool attributes and methods.
203 - Refine error types thrown.
207 - Fix continuous integration build on windows.
208 - Fix code coverage reporting by using c8 instead of nyc.
210 ## [2.3.5] - 2022-10-21
214 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
215 - Optimize tasks usage lookup implementation.
219 - Fix missed pool event emitter type export.
220 - Fix typedoc documentation generation.
222 ## [2.3.4] - 2022-10-17
226 - Fully automate release process with release-it.
230 - Optimize fair share task scheduling algorithm implementation.
231 - Update benchmarks versus external pools results with latest version.
233 ## [2.3.3] - 2022-10-15
237 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
239 ## [2.3.2] - 2022-10-14
243 - Optimize fair share worker selection strategy implementation.
247 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
249 ## [2.3.1] - 2022-10-13
253 - Pool worker choice strategies:
254 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
255 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
257 ## [2.2.2] - 2022-10-09
261 - Fixed `README.md` file.
263 ## [2.2.1] - 2022-10-08
267 - Dynamic worker choice strategy change at runtime.
269 ## [2.2.0] - 2022-01-05
273 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
275 ## [2.1.0] - 2021-08-29
279 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
283 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
284 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
285 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
286 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
288 ## [2.0.2] - 2021-05-12
292 - Fix `busy` event emission on fixed pool type
294 ## [2.0.1] - 2021-03-16
298 - Check if pool options are properly set.
299 - `busy` event is emitted on all pool types.
301 ## [2.0.0] - 2021-03-01
305 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
309 - `FullPool` event is now renamed to `busy`.
310 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
311 _Find more details on our JSDoc._
313 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
315 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
317 ### Pool options types declaration merge
319 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
321 #### New `export` strategy
325 const DynamicThreadPool = require('poolifier/lib/dynamic')
327 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
330 But you should always prefer just using
333 const { DynamicThreadPool } = require('poolifier')
336 #### New type definitions for input data and response
338 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
339 _This is not a limitation by poolifier but NodeJS._
341 #### Public property replacements
343 `numWorkers` property is now `numberOfWorkers`
345 #### Internal (protected) properties and methods renaming
347 These properties are not intended for end users
349 - `id` => `nextMessageId`
351 These methods are not intended for end users
353 - `_chooseWorker` => `chooseWorker`
354 - `_newWorker` => `createWorker`
355 - `_execute` => `internalExecute`
356 - `_chooseWorker` => `chooseWorker`
357 - `_checkAlive` => `checkAlive`
359 - `_runAsync` => `runAsync`
361 ## [1.1.0] - 2020-05-21
365 - ThreadWorker support async functions as option
366 - Various external library patches
368 ## [1.0.0] - 2020-01-24
372 - FixedThreadPool implementation
373 - DynamicThreadPool implementation
374 - WorkerThread implementation to improve developer experience