From: Jérôme Benoit Date: Wed, 5 Apr 2023 10:49:29 +0000 (+0200) Subject: refactor: propagate generics type X-Git-Tag: v2.4.1~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d59df138a323dd194fcf1a8e2095142df3fc9fb9;p=poolifier.git refactor: propagate generics type Signed-off-by: Jérôme Benoit --- 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 )