perf: bind to this some methods in the tasks execution code path
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index bd616a54d666ffc3372d09e040686e3e9aa1aca2..1564e0f0f73e1c41d6da2f9d157620439f3489f8 100644 (file)
@@ -36,6 +36,7 @@ export class WorkerChoiceStrategyContext<
     private readonly createWorkerCallback: () => number,
     workerChoiceStrategy: WorkerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN
   ) {
+    this.execute.bind(this)
     this.setWorkerChoiceStrategy(workerChoiceStrategy)
   }