feat: add pool runtime setters
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index b075c4eac5ae3cd9cd88b41553263b11e2e5af95..5e9f7de9dce24e1510e52d68c09bfb6486df1f52 100644 (file)
@@ -127,4 +127,15 @@ export class WorkerChoiceStrategyContext<
       ) as IWorkerChoiceStrategy
     ).remove(workerNodeKey)
   }
+
+  /**
+   * Sets the worker choice strategies in the context options.
+   *
+   * @param opts - The worker choice strategy options.
+   */
+  public setOptions (opts: WorkerChoiceStrategyOptions): void {
+    this.workerChoiceStrategies.forEach(workerChoiceStrategy => {
+      workerChoiceStrategy.setOptions(opts)
+    })
+  }
 }