feat: add transferable objects support to worker_threads pool
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
d4abc60a 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
522eea03 6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
45a5a54c
JB
8## [Unreleased]
9
7d91a8cd
JB
10### Added
11
12- Add array of transferable objects to the `execute()` method arguments.
13
6b4263b4
JB
14## [2.6.23] - 2023-08-11
15
3d76750a 16### Fixed
8e0af894 17
3d76750a 18- Fix pool busyness semantic when tasks queueing is enabled: the pool is busy when the number of executing tasks on each worker has reached the maximum tasks concurrency per worker.
9606b474 19
3d76750a
JB
20### Added
21
22- HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
a8706532 23- HTTP server pool examples: express, fastify.
3d76750a
JB
24
25## [2.6.22] - 2023-08-10
9606b474 26
3d76750a 27### Fixed
9606b474
JB
28
29- Add missing `types` field to package.json `exports`.
30
3d76750a
JB
31### Changed
32
33- Structure markdown documentation (PR #811).
34
d9647bdd
JB
35## [2.6.21] - 2023-08-03
36
2111ec12
JB
37### Changed
38
39- Improve code documentation.
40- Code refactoring and cleanup for better maintainability and readability.
41
5c30b9d9
JB
42## [2.6.20] - 2023-07-21
43
10ecf8fd
JB
44### Fixed
45
46- Fix queued tasks redistribution on error task execution starvation.
4e377863 47- Ensure task queueing per worker condition is untangled from the pool busyness semantic.
10ecf8fd 48
aa9eede8
JB
49### Changed
50
7c89e6a4 51- Drastically reduce lookups by worker in the worker nodes.
aa9eede8 52
62485908
JB
53## [2.6.19] - 2023-07-20
54
2e2ef9c3
JB
55### Added
56
57- Dedicated internal communication channel for worker_threads pools.
58
8f4c9491
JB
59## [2.6.18] - 2023-07-19
60
8660b972
JB
61### Changed
62
63- Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
64
206a3519
JB
65## [2.6.17] - 2023-07-16
66
b4899fae
JB
67### Added
68
b569873d 69- Add `listTaskFunctions()` method to worker class.
b4899fae 70
58a06a6c
JB
71## [2.6.16] - 2023-07-12
72
2a69b8c5
JB
73### Fixed
74
80520ca4 75- Fix pool startup detection.
2a69b8c5
JB
76- Fix worker task functions handling.
77
b5900b02
JB
78## [2.6.15] - 2023-07-11
79
19dbc45b
JB
80### Added
81
82- Take into account worker node readiness in worker choice strategies.
83
4a0db581
JB
84## [2.6.14] - 2023-07-10
85
87e44747
JB
86### Fixed
87
88- Fix task function statistics tracking.
89
0265272f
JB
90## [2.6.13] - 2023-07-10
91
968a2e8c
JB
92### Added
93
94- Add per task function statistics tracking.
782299f8 95- Add public methods to manipulate the worker task functions at runtime.
968a2e8c 96
44c8c00f
JB
97## [2.6.12] - 2023-07-09
98
aa4bf4b2
JB
99### Fixed
100
101- Workaround import issue with `node:os` module in node 16.x.x.
102
b7cfced1
JB
103## [2.6.11] - 2023-07-09
104
d5024c00
JB
105### Fixed
106
107- Fix pool readiness semantic.
108
f313a208
JB
109## [2.6.10] - 2023-07-08
110
2431bdb4
JB
111### Fixed
112
113- Ensure workers are not recreated on error at pool startup.
114
115### Added
116
117- Add `ready` and `strategy` fields to pool information.
118- Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
caadbd41 119- Add dynamic pool sizing checks.
2431bdb4 120
369d0a51
JB
121## [2.6.9] - 2023-07-07
122
2845f2a5
JB
123### Fixed
124
125- Recreate the right worker type on uncaught exception.
126
127### Added
128
129- Add minimum and maximum to internal measurement statistics.
1dcf8b7b 130- Add `runTime` and `waitTime` to pool information.
75d3401a 131- Check worker inactive time only on dynamic worker.
2845f2a5 132
fc97d613
JB
133## [2.6.8] - 2023-07-03
134
92b1feaa
JB
135### Fixed
136
137- Brown paper bag release to fix version handling in pool information.
138
52d54060
JB
139## [2.6.7] - 2023-07-03
140
5bc91f3e
JB
141### Fixed
142
143- Ensure worker queued tasks at error are reassigned to other pool workers.
144
afe0d5bf
JB
145### Added
146
147- Add pool `utilization` ratio to pool information.
23ccf9d7 148- Add `version` to pool information.
e5b3047d 149- Add worker information to worker nodes.
afe0d5bf 150
f42c583f
JB
151## [2.6.6] - 2023-07-01
152
6961ca9a
JB
153### Added
154
155- Add safe helper `availableParallelism` to help sizing the pool.
156
3749facb
JB
157### Fixed
158
159- Ensure message handler is only registered in worker.
160
6fed2513
JB
161## [2.6.5] - 2023-06-27
162
c72f6987
JB
163### Known issues
164
70726c28 165- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
c72f6987
JB
166
167### Fixed
168
169- Artificial version bump to 2.6.5 to workaround publication issue.
170- Ensure cluster pool destroy() gracefully shutdowns worker's server.
171- Ensure pool event is emitted before task error promise rejection.
172- Fix queued tasks count computation.
173
174### Removed
175
2fbe1783 176- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
c72f6987 177
6426631b
JB
178## [2.6.4] - 2023-06-27
179
941f9a7c
JB
180### Known issues
181
70726c28 182- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
941f9a7c 183
2c039e43
JB
184### Fixed
185
186- Ensure cluster pool destroy() gracefully shutdowns worker's server.
187- Ensure pool event is emitted before task error promise rejection.
9c16fb4b 188- Fix queued tasks count computation.
2c039e43 189
941f9a7c
JB
190### Removed
191
2fbe1783 192- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
941f9a7c 193
bc1b0765
JB
194## [2.6.3] - 2023-06-19
195
a6a2dc4c
JB
196### Fixed
197
198- Ensure no tasks are queued when trying to soft kill a dynamic worker.
f0d7f803 199- Update strategies internals after statistics computation.
a6a2dc4c 200
7b56f532
JB
201### Changed
202
203- Optimize O(1) queue implementation.
204
b628596c
JB
205## [2.6.2] - 2023-06-12
206
a9e89d00
JB
207### Fixed
208
209- Fix new worker use after creation in dynamic pool given the current worker choice strategy.
210
4368a898
JB
211## [2.6.1] - 2023-06-10
212
931d43e2
JB
213### Added
214
13ab5b87 215- Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
931d43e2 216
f1c06930
JB
217### Fixed
218
219- Fix average statistics computation: ensure failed tasks are not accounted.
220
16671b07
JB
221## [2.6.0] - 2023-06-09
222
a1347286
JB
223### Added
224
5af9c0f7 225- Add `LEAST_ELU` worker choice strategy (experimental).
9adcefab 226- Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
a1347286 227
1c6fe997
JB
228### Changed
229
230- Refactor pool worker node usage internals.
477f48e7 231- Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
f63a9dda 232- Breaking change: pool information `info` property object fields have been renamed.
1c6fe997
JB
233
234### Fixed
235
236- Fix wait time accounting.
237- Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
238- Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
239
aa07d6ee
JB
240## [2.5.4] - 2023-06-07
241
b6b32453
JB
242### Added
243
244- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
245
246### Changed
247
248- Compute statistics at the worker level only if needed.
2fbe1783 249- Add `worker_threads` options to thread pool options.
b6b32453 250
272d4d8f
JB
251### Fixed
252
253- Make the `LEAST_BUSY` strategy only relies on task runtime.
254
ed47fb3d
JB
255## [2.5.3] - 2023-06-04
256
89a4abfd
JB
257### Changed
258
259- Refine pool information content.
b4213b7f 260- Limit pool internals public exposure.
89a4abfd 261
8a9febf5
JB
262## [2.5.2] - 2023-06-02
263
91ee39ed
JB
264### Added
265
266- Add `taskError` pool event for task execution error.
6b27d407 267- Add pool information `info` property to pool.
91ee39ed
JB
268- Emit pool information on `busy` and `full` pool events.
269
8babb151
JB
270## [2.5.1] - 2023-06-01
271
0e05c4dc
JB
272### Added
273
1f68cede 274- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
91ee39ed 275- Add `error` pool event for uncaught worker error.
0e05c4dc 276
a8766181
JB
277## [2.5.0] - 2023-05-31
278
e4543b14
JB
279### Added
280
281- Switch pool event emitter to `EventEmitterAsyncResource`.
6da80d38 282- Add tasks wait time accounting in per worker tasks usage.
5af9c0f7 283- Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
e4543b14
JB
284
285### Changed
286
287- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
288
570efb11
JB
289## [2.4.14] - 2023-05-09
290
b0f28bad
JB
291### Fixed
292
293- Ensure no undefined task runtime can land in the tasks history.
294- Fix median computation implementation once again.
295
110b6d13
JB
296### Added
297
298- Unit tests for median and queue implementations.
299
72584880
JB
300## [2.4.13] - 2023-05-08
301
b0d6ed8f
JB
302### Fixed
303
e3058615 304- Fix worker choice strategy options validation.
b0d6ed8f
JB
305- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
306
06140c32
JB
307## [2.4.12] - 2023-05-06
308
a86b6df1
JB
309### Added
310
311- Support multiple task functions per worker.
08f3f44c 312- Add custom worker weights support to worker choice strategies options.
a86b6df1 313
29ee7e9a
JB
314### Changed
315
316- Use O(1) queue implementation for tasks queueing.
317
0682ba15
JB
318### Fixed
319
320- Fix median computation implementation.
321- Fix fair share worker choice strategy internals update.
322
936d53ec
JB
323## [2.4.11] - 2023-04-23
324
cb70b19d
JB
325### Changed
326
327- Optimize free worker finding in worker choice strategies.
328
15bb637a
JB
329## [2.4.10] - 2023-04-15
330
ef41a6e6
JB
331### Fixed
332
82ea6492 333- Fix typescript type definition for task function: ensure the input data is optional.
ef41a6e6
JB
334- Fix typescript type definition for pool execute(): ensure the input data is optional.
335
181eb2b4
JB
336## [2.4.9] - 2023-04-15
337
a20f0ba5
JB
338### Added
339
340- Add tasks queue enablement runtime setter to pool.
341- Add tasks queue options runtime setter to pool.
342- Add worker choice strategy options runtime setter to pool.
343
344### Changed
345
346- Remove the tasks queuing experimental status.
347
d4aeae5a
JB
348### Fixed
349
82ea6492 350- Fix task function type definition and validation.
2fc5cae3 351- Fix worker choice strategy options handling.
d4aeae5a 352
1d9e7023
JB
353## [2.4.8] - 2023-04-12
354
f9b4bbf8
JB
355### Fixed
356
357- Fix message between main worker and worker type definition for tasks.
358- Fix code documentation.
359
12ae3210
JB
360## [2.4.7] - 2023-04-11
361
7171d33f
JB
362### Added
363
364- Add worker tasks queue options to pool options.
365
e8bd29ce
JB
366### Fixed
367
368- Fix missing documentation.
369
42c7bc10
JB
370## [2.4.6] - 2023-04-10
371
681196cc
JB
372### Fixed
373
374- Ensure one task at a time is executed per worker with tasks queueing enabled.
1c6fe997 375- Properly count worker executing tasks with tasks queueing enabled.
681196cc 376
54d360e3
JB
377## [2.4.5] - 2023-04-09
378
3fafb1b2
JB
379### Added
380
9e775f96
JB
381- Use monotonic high resolution timer for worker tasks runtime.
382- Add worker tasks median runtime to statistics.
ff733df7 383- Add worker tasks queue (experimental).
3fafb1b2 384
92fa3eb6
JB
385## [2.4.4] - 2023-04-07
386
aee46736
JB
387### Added
388
389- Add `PoolEvents` enumeration and `PoolEvent` type.
390
36b5e78f
JB
391### Fixed
392
ff0c2b3e 393- Destroy worker only on alive check.
36b5e78f 394
9fb0f324
JB
395## [2.4.3] - 2023-04-07
396
28cf3617
JB
397### Fixed
398
399- Fix typedoc generation with inheritance.
400
848f0f27
JB
401## [2.4.2] - 2023-04-06
402
164d950a
JB
403### Added
404
405- Add `full` event to dynamic pool.
32417142 406- Keep worker choice strategy in memory for conditional reuse.
164d950a 407
78ab2555
JB
408### Fixed
409
410- Fix possible negative worker key at worker removal in worker choice strategies.
411
79aafe9f
JB
412## [2.4.1] - 2023-04-05
413
9cd39dd4
JB
414### Changed
415
416- Optimize worker choice strategy for dynamic pool.
417
965415bb
JB
418### Fixed
419
420- Ensure dynamic pool does not alter worker choice strategy expected behavior.
421
d8b60b1c
JB
422## [2.4.0] - 2023-04-04
423
c6bd2650
JB
424### Added
425
426- Add `LESS_BUSY` worker choice strategy.
427
428### Changed
429
430- Optimize worker storage in pool.
431- Optimize worker alive status check.
432- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
433- Optimize `LESS_USED` worker choice strategy.
434- Update benchmarks versus external threads pools.
435- Optimize tasks usage statistics requirements for worker choice strategy.
436
437### Fixed
438
439- Ensure trimmable characters are checked at pool initialization.
440- Fix message id integer overflow.
441- Fix pool worker removal in worker choice strategy internals.
442- Fix package publication with pnpm.
443
d0a3f018
JB
444## [2.4.0-3] - 2023-04-04
445
b2ede285
JB
446### Added
447
448- Add `LESS_BUSY` worker choice strategy.
449
450### Changed
451
452- Optimize worker storage in pool.
453- Optimize worker alive status check.
454- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
455- Optimize `LESS_USED` worker choice strategy.
456- Update benchmarks versus external threads pools.
457
458### Fixed
459
460- Ensure trimmable characters are checked at pool initialization.
461- Fix message id integer overflow.
462- Fix pool worker removal in worker choice strategy internals.
463- Fix package publication with pnpm.
464
a015ea40
JB
465## [2.4.0-2] - 2023-04-03
466
698f4bbc
JB
467### Added
468
469- Add `LESS_BUSY` worker choice strategy.
470
471### Changed
472
473- Optimize worker storage in pool.
474- Optimize worker alive status check.
475- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
476- Optimize `LESS_USED` worker choice strategy.
477
478### Fixed
479
480- Ensure trimmable characters are checked at pool initialization.
481- Fix message id integer overflow.
482- Fix pool worker removal in worker choice strategy internals.
483- Fix package publication with pnpm.
484
8fe15920
JB
485## [2.4.0-1] - 2023-04-03
486
5b301c28
JB
487### Added
488
489- Add `LESS_BUSY` worker choice strategy.
490
491### Changed
492
493- Optimize worker storage in pool.
494- Optimize worker alive status check.
495- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
496- Optimize `LESS_USED` worker choice strategy.
497
498### Fixed
499
500- Ensure trimmable characters are checked at pool initialization.
501- Fix message id integer overflow.
502- Fix pool worker removal in worker choice strategy internals.
503
2fb9ca9c
JB
504## [2.4.0-0] - 2023-04-03
505
168c526f
JB
506### Added
507
508- Add `LESS_BUSY` worker choice strategy.
509
1d71a908
JB
510### Changed
511
ffcbbad8 512- Optimize worker storage in pool.
1d71a908 513- Optimize worker alive status check.
65a60b3b 514- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
737c6d97 515- Optimize `LESS_USED` worker choice strategy.
1d71a908 516
ffcbbad8
JB
517### Fixed
518
519- Ensure trimmable characters are checked at pool initialization.
b4e75778 520- Fix message id integer overflow.
97a2abc3 521- Fix pool worker removal in worker choice strategy internals.
ffcbbad8 522
08372738
JB
523## [2.3.10] - 2023-03-18
524
710826bc
JB
525### Fixed
526
9606b474 527- Fix package.json `exports` syntax for ESM and CommonJS.
710826bc
JB
528
529### Changed
530
531- Permit SemVer pre-release publication.
76e5ac6f 532
e4796ecd
JB
533## [2.3.10-2] - 2023-03-18
534
6abad580
JB
535### Fixed
536
9606b474 537- Fix package.json `exports` syntax for ESM and CommonJS.
6abad580 538
a2ee98cc
JB
539## [2.3.10-1] - 2023-03-18
540
7e060cee
JB
541### Changed
542
90483887 543- Permit SemVer pre-release publication.
7e060cee 544
c81bfafb
JB
545## [2.3.10-0] - 2023-03-18
546
fe18768d
JB
547### Fixed
548
9606b474 549- Fix package.json `exports` syntax for ESM and CommonJS.
fe18768d 550
d7b78217
JB
551## [2.3.9] - 2023-03-18
552
ed6dd37f
JB
553### Changed
554
555- Introduce ESM module support along with CommonJS one.
556
557### Fixed
558
559- Fix brown paper bag bug referencing the same object literal.
560
68e2ad86
JB
561## [2.3.8] - 2023-03-18
562
ca6c7d70
JB
563### Changed
564
565- Switch internal benchmarking code to benny.
fbdedeb9
JB
566- Switch to TypeScript 5.x.x.
567- Switch rollup bundler plugins to core ones.
ed6dd37f 568- Switch to TSDoc syntax.
fbdedeb9 569- Enforce conventional commits.
ca6c7d70 570
d15211d4
JB
571### Fixed
572
573- Fix random integer generator.
fbdedeb9 574- Fix worker choice strategy pool type identification at initialization.
d15211d4 575
995705ea
JB
576## [2.3.7] - 2022-10-23
577
b953022b
JB
578### Changed
579
580- Switch to open collective FOSS project funding platform.
78cea37e
JB
581- Switch to ts-standard linter configuration on TypeScript code.
582
583### Fixed
584
585- Fixed missing async on pool execute method.
586- Fixed typing in TypeScript example.
587- Fixed types in unit tests.
b953022b 588
3b9f6953
JB
589## [2.3.6] - 2022-10-22
590
f80cead4
JB
591### Changed
592
593- Cleanup pool attributes and methods.
594- Refine error types thrown.
595
596### Fixed
597
598- Fix continuous integration build on windows.
599- Fix code coverage reporting by using c8 instead of nyc.
600
efc22107
JB
601## [2.3.5] - 2022-10-21
602
7a6a0a96
JB
603### Changed
604
a05c10de
JB
605- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
606- Optimize tasks usage lookup implementation.
7a6a0a96 607
b4904890
JB
608### Fixed
609
610- Fix missed pool event emitter type export.
611- Fix typedoc documentation generation.
612
a875f8d1
JB
613## [2.3.4] - 2022-10-17
614
73cda448
JB
615### Added
616
617- Fully automate release process with release-it.
618
45a5a54c
JB
619### Changed
620
73cda448 621- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 622- Update benchmarks versus external pools results with latest version.
45a5a54c 623
90ee1b18 624## [2.3.3] - 2022-10-15
1a76932b
JB
625
626### Added
627
628- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
629
90ee1b18 630## [2.3.2] - 2022-10-14
11df3590
JB
631
632### Changed
633
634- Optimize fair share worker selection strategy implementation.
635
636### Fixed
637
638- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
639
90ee1b18 640## [2.3.1] - 2022-10-13
23ff945a
JB
641
642### Added
643
644- Pool worker choice strategies:
645 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
646 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
647
90ee1b18 648## [2.2.2] - 2022-10-09
cb2b6c69
JB
649
650### Fixed
651
652- Fixed `README.md` file.
653
90ee1b18 654## [2.2.1] - 2022-10-08
bdacc2d2 655
bdaf31cd
JB
656### Added
657
658- Dynamic worker choice strategy change at runtime.
bdacc2d2 659
90ee1b18 660## [2.2.0] - 2022-01-05
7e0d447f
JB
661
662### Breaking Changes
663
9606b474 664- Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
7e0d447f 665
90ee1b18 666## [2.1.0] - 2021-08-29
35cf1c03
JB
667
668### Added
669
670- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
671
672### Breaking Changes
673
674- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
675- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
676- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 677- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 678
90ee1b18 679## [2.0.2] - 2021-05-12
14916bf9
JB
680
681### Bug fixes
682
683- Fix `busy` event emission on fixed pool type
684
90ee1b18 685## [2.0.1] - 2021-03-16
7f685093
JB
686
687### Bug fixes
688
689- Check if pool options are properly set.
690- `busy` event is emitted on all pool types.
691
90ee1b18 692## [2.0.0] - 2021-03-01
fa0f5b28 693
f3f833ab 694### Bug fixes
d63d3be3 695
ddbeaffd 696- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 697
fa0f5b28
S
698### Breaking Changes
699
7f685093 700- `FullPool` event is now renamed to `busy`.
1927ee67 701- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 702 _Find more details on our JSDoc._
ddbeaffd 703
1927ee67
APA
704- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
705
ddbeaffd 706- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 707
ec2ccfc8
JB
708### Pool options types declaration merge
709
710`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
711
fa0f5b28
S
712#### New `export` strategy
713
714```js
715// Before
777b7824 716const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 717// After
777b7824 718const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
719```
720
721But you should always prefer just using
722
723```js
777b7824 724const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
725```
726
d3c8a1a8
S
727#### New type definitions for input data and response
728
6677a3d3 729For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
9606b474 730_This is not a limitation by poolifier but Node.js._
d3c8a1a8 731
3a4b605f 732#### Public property replacements
5c5a1fb7 733
3a4b605f 734`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 735
280c2a77 736#### Internal (protected) properties and methods renaming
fa0f5b28 737
280c2a77
S
738These properties are not intended for end users
739
740- `id` => `nextMessageId`
741
742These methods are not intended for end users
fa0f5b28
S
743
744- `_chooseWorker` => `chooseWorker`
280c2a77 745- `_newWorker` => `createWorker`
fa0f5b28
S
746- `_execute` => `internalExecute`
747- `_chooseWorker` => `chooseWorker`
748- `_checkAlive` => `checkAlive`
749- `_run` => `run`
750- `_runAsync` => `runAsync`
751
90ee1b18 752## [1.1.0] - 2020-05-21
0312f71a
APA
753
754### Added
755
756- ThreadWorker support async functions as option
cf9aa6c3 757- Various external library patches
0312f71a 758
90ee1b18 759## [1.0.0] - 2020-01-24
522eea03 760
761### Added
762
763- FixedThreadPool implementation
764- DynamicThreadPool implementation
0312f71a 765- WorkerThread implementation to improve developer experience