From 59219cbb5238cb64af71637ef062f537b63c55c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 15 Apr 2023 14:07:52 +0200 Subject: [PATCH] refactor: align pool setters signature MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 6 +++++- src/pools/pool.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index f1c6ad13..9290c218 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -216,7 +216,8 @@ export abstract class AbstractPool< /** @inheritDoc */ public setWorkerChoiceStrategy ( - workerChoiceStrategy: WorkerChoiceStrategy + workerChoiceStrategy: WorkerChoiceStrategy, + workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions ): void { this.checkValidWorkerChoiceStrategy(workerChoiceStrategy) this.opts.workerChoiceStrategy = workerChoiceStrategy @@ -234,6 +235,9 @@ export abstract class AbstractPool< this.workerChoiceStrategyContext.setWorkerChoiceStrategy( this.opts.workerChoiceStrategy ) + if (workerChoiceStrategyOptions != null) { + this.setWorkerChoiceStrategyOptions(workerChoiceStrategyOptions) + } } /** @inheritDoc */ diff --git a/src/pools/pool.ts b/src/pools/pool.ts index ea60833a..a0663ba5 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -163,8 +163,12 @@ export interface IPool< * Sets the worker choice strategy in this pool. * * @param workerChoiceStrategy - The worker choice strategy. + * @param workerChoiceStrategyOptions - The worker choice strategy options. */ - setWorkerChoiceStrategy: (workerChoiceStrategy: WorkerChoiceStrategy) => void + setWorkerChoiceStrategy: ( + workerChoiceStrategy: WorkerChoiceStrategy, + workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions + ) => void /** * Sets the worker choice strategy options in this pool. * -- 2.34.1