Remove redundant await
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
bdacc2d2
JB
8## [2.2.1] - 2022-05-01
9
10-
11
72ddc5cb 12## [2.2.0] - 2022-05-01
7e0d447f
JB
13
14### Breaking Changes
15
16- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
17
f30df385 18## [2.1.0] - 2021-29-08
35cf1c03
JB
19
20### Added
21
22- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
23
24### Breaking Changes
25
26- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
27- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
28- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 29- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 30
d7a0c5c5 31## [2.0.2] - 2021-12-05
14916bf9
JB
32
33### Bug fixes
34
35- Fix `busy` event emission on fixed pool type
36
59af1281 37## [2.0.1] - 2021-16-03
7f685093
JB
38
39### Bug fixes
40
41- Check if pool options are properly set.
42- `busy` event is emitted on all pool types.
43
3695a6b0 44## [2.0.0] - 2021-01-03
fa0f5b28 45
f3f833ab 46### Bug fixes
d63d3be3 47
ddbeaffd 48- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 49
fa0f5b28
S
50### Breaking Changes
51
7f685093 52- `FullPool` event is now renamed to `busy`.
1927ee67 53- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 54 _Find more details on our JSDoc._
ddbeaffd 55
1927ee67
APA
56- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
57
ddbeaffd 58- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 59
ec2ccfc8
JB
60### Pool options types declaration merge
61
62`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
63
fa0f5b28
S
64#### New `export` strategy
65
66```js
67// Before
777b7824 68const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 69// After
777b7824 70const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
71```
72
73But you should always prefer just using
74
75```js
777b7824 76const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
77```
78
d3c8a1a8
S
79#### New type definitions for input data and response
80
ec2ccfc8 81For cluster worker and worker-thread pools, you can now only send and receive serializable data.
d3c8a1a8
S
82_This is not a limitation by poolifier but NodeJS._
83
3a4b605f 84#### Public property replacements
5c5a1fb7 85
3a4b605f 86`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 87
280c2a77 88#### Internal (protected) properties and methods renaming
fa0f5b28 89
280c2a77
S
90These properties are not intended for end users
91
92- `id` => `nextMessageId`
93
94These methods are not intended for end users
fa0f5b28
S
95
96- `_chooseWorker` => `chooseWorker`
280c2a77 97- `_newWorker` => `createWorker`
fa0f5b28
S
98- `_execute` => `internalExecute`
99- `_chooseWorker` => `chooseWorker`
100- `_checkAlive` => `checkAlive`
101- `_run` => `run`
102- `_runAsync` => `runAsync`
103
0312f71a
APA
104## [1.1.0] - 2020-21-05
105
106### Added
107
108- ThreadWorker support async functions as option
cf9aa6c3 109- Various external library patches
0312f71a 110
522eea03 111## [1.0.0] - 2020-24-01
112
113### Added
114
115- FixedThreadPool implementation
116- DynamicThreadPool implementation
0312f71a 117- WorkerThread implementation to improve developer experience