From: Jérôme Benoit Date: Mon, 18 Sep 2023 20:18:54 +0000 (+0200) Subject: docs: refine changelog entry X-Git-Tag: v2.7.0~1^2~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=16248b233364112df0972c0e9154941f561f09cc;p=poolifier.git docs: refine changelog entry Signed-off-by: Jérôme Benoit --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f5bda97..b6ba6fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API. +- Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API. - Stricter worker constructor arguments validation. ## [2.6.45] - 2023-09-17 diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 7be2cef5..779d2b59 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -860,7 +860,7 @@ export abstract class AbstractPool< public async removeTaskFunction (name: string): Promise { if (!this.taskFunctions.has(name)) { throw new Error( - 'Cannot remove a task function that does not exist on the pool side' + 'Cannot remove a task function not handled on the pool side' ) } this.taskFunctions.delete(name) diff --git a/src/utility-types.ts b/src/utility-types.ts index 3817515a..48988c08 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -119,7 +119,7 @@ export interface MessageValue /** * Task function operation: * - `'add'` - Add a task function. - * - `'delete'` - Delete a task function. + * - `'remove'` - Remove a task function. * - `'default'` - Set a task function as default. */ readonly taskFunctionOperation?: 'add' | 'remove' | 'default' diff --git a/tests/pools/abstract/abstract-pool.test.js b/tests/pools/abstract/abstract-pool.test.js index 5c27a4b6..e9cca732 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -1319,9 +1319,7 @@ describe('Abstract pool test suite', () => { await expect( dynamicThreadPool.removeTaskFunction('test') ).rejects.toThrowError( - new Error( - 'Cannot remove a task function that does not exist on the pool side' - ) + new Error('Cannot remove a task function not handled on the pool side') ) const echoTaskFunction = data => { return data