From d59df138a323dd194fcf1a8e2095142df3fc9fb9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 5 Apr 2023 12:49:29 +0200 Subject: [PATCH] refactor: propagate generics type 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 +++++- .../selection-strategies/worker-choice-strategy-context.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 1e61071c..fa1a8ba1 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -88,7 +88,11 @@ export abstract class AbstractPool< if (this.opts.enableEvents === true) { this.emitter = new PoolEmitter() } - this.workerChoiceStrategyContext = new WorkerChoiceStrategyContext( + this.workerChoiceStrategyContext = new WorkerChoiceStrategyContext< + Worker, + Data, + Response + >( this, () => { const createdWorker = this.createAndSetupWorker() diff --git a/src/pools/selection-strategies/worker-choice-strategy-context.ts b/src/pools/selection-strategies/worker-choice-strategy-context.ts index f6e0feab..3d122f02 100644 --- a/src/pools/selection-strategies/worker-choice-strategy-context.ts +++ b/src/pools/selection-strategies/worker-choice-strategy-context.ts @@ -57,7 +57,7 @@ export class WorkerChoiceStrategyContext< workerChoiceStrategy: WorkerChoiceStrategy ): void { this.workerChoiceStrategy?.reset() - this.workerChoiceStrategy = getWorkerChoiceStrategy( + this.workerChoiceStrategy = getWorkerChoiceStrategy( this.pool, workerChoiceStrategy ) -- 2.34.1