b2525a5eae39d5f417e1890f7e517c74357c7c6b
[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 ## [2.0.2] - 2021-12-05
9
10 ### Bug fixes
11
12 - Fix `busy` event emission on fixed pool type
13
14 ## [2.0.1] - 2021-16-03
15
16 ### Bug fixes
17
18 - Check if pool options are properly set.
19 - `busy` event is emitted on all pool types.
20
21 ## [2.0.0] - 2021-01-03
22
23 ### Bug fixes
24
25 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
26
27 ### Breaking Changes
28
29 - `FullPool` event is now renamed to `busy`.
30 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
31 _Find more details on our JSDoc._
32
33 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
34
35 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
36
37 ### Pool options types declaration merge
38
39 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
40
41 #### New `export` strategy
42
43 ```js
44 // Before
45 const DynamicThreadPool = require('poolifier/lib/dynamic')
46 // After
47 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
48 ```
49
50 But you should always prefer just using
51
52 ```js
53 const { DynamicThreadPool } = require('poolifier')
54 ```
55
56 #### New type definitions for input data and response
57
58 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
59 _This is not a limitation by poolifier but NodeJS._
60
61 #### Public property replacements
62
63 `numWorkers` property is now `numberOfWorkers`
64
65 #### Internal (protected) properties and methods renaming
66
67 These properties are not intended for end users
68
69 - `id` => `nextMessageId`
70
71 These methods are not intended for end users
72
73 - `_chooseWorker` => `chooseWorker`
74 - `_newWorker` => `createWorker`
75 - `_execute` => `internalExecute`
76 - `_chooseWorker` => `chooseWorker`
77 - `_checkAlive` => `checkAlive`
78 - `_run` => `run`
79 - `_runAsync` => `runAsync`
80
81 ## [1.1.0] - 2020-21-05
82
83 ### Added
84
85 - ThreadWorker support async functions as option
86 - Various external library patches
87
88 ## [1.0.0] - 2020-24-01
89
90 ### Added
91
92 - FixedThreadPool implementation
93 - DynamicThreadPool implementation
94 - WorkerThread implementation to improve developer experience