refactor: propagate generics type
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 10:49:29 +0000 (12:49 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 10:49:29 +0000 (12:49 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts
src/pools/selection-strategies/worker-choice-strategy-context.ts

index 1e61071c42382e1ccb9d546cb0a035ac6196afe3..fa1a8ba1382c131d97b2cab70d6d3e1df7bd0829 100644 (file)
@@ -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()
index f6e0feab2e8cb425fec1da9f420deba8b75135e1..3d122f0292d77805a3e59fb56a386fbec1b54396 100644 (file)
@@ -57,7 +57,7 @@ export class WorkerChoiceStrategyContext<
     workerChoiceStrategy: WorkerChoiceStrategy
   ): void {
     this.workerChoiceStrategy?.reset()
-    this.workerChoiceStrategy = getWorkerChoiceStrategy(
+    this.workerChoiceStrategy = getWorkerChoiceStrategy<Worker, Data, Response>(
       this.pool,
       workerChoiceStrategy
     )