From: Jérôme Benoit Date: Fri, 18 Aug 2023 19:17:44 +0000 (+0200) Subject: docs: improve backPressure event documentation X-Git-Tag: v2.6.29~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=445264e81bd5f5294bea64a0ab396e9808fbece8;p=poolifier.git docs: improve backPressure event documentation Signed-off-by: Jérôme Benoit --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c61fc49..4e013050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add back pressure detection on the worker node queue. Event `backPressure` is emitted all worker node queues are full (worker node queue size >= poolMaxSize^2). +- Add back pressure detection on the worker node queue. Event `backPressure` is emitted when all worker node queues are full (worker node queue size >= poolMaxSize^2). - Use back pressure detection in worker choice strategies. - Add worker choice strategies retries mechanism if no worker is eligible. diff --git a/docs/api.md b/docs/api.md index a48f4c54..1848c130 100644 --- a/docs/api.md +++ b/docs/api.md @@ -94,7 +94,8 @@ An object with these properties: Properties: - `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. It must be a positive integer. - Default: `{ concurrency: 1 }` + + Default: `{ concurrency: 1 }` #### `ThreadPoolOptions extends PoolOptions` diff --git a/src/pools/pool.ts b/src/pools/pool.ts index 427dfd1c..e65cc115 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -201,7 +201,7 @@ export interface IPool< * - '`destroy`': Emitted when the pool is destroyed. * - `'error'`: Emitted when an uncaught error occurs. * - `'taskError'`: Emitted when an error occurs while executing a task. - * - `'backPressure'`: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full). + * - `'backPressure'`: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size \>= pool maximum size^2). */ readonly emitter?: PoolEmitter /**