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