Merge branch 'master' into interleaved-weighted-round-robin-worker-choice-strategy
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index 9ea46316becf64161e4f7736550bae465d22bf7e..0d0d269c076537bd2018cc4cc9450ea43584a6b8 100644 (file)
@@ -140,7 +140,7 @@ export class WorkerChoiceStrategyContext<
    * Executes the worker choice strategy algorithm in the context.
    *
    * @returns The key of the worker node.
-   * @throws {@link Error} If the worker node key is null or undefined.
+   * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker node key is null or undefined.
    */
   public execute (): number {
     const workerNodeKey = (
@@ -174,8 +174,8 @@ export class WorkerChoiceStrategyContext<
    * @param opts - The worker choice strategy options.
    */
   public setOptions (opts: WorkerChoiceStrategyOptions): void {
-    this.workerChoiceStrategies.forEach(workerChoiceStrategy => {
+    for (const workerChoiceStrategy of this.workerChoiceStrategies.values()) {
       workerChoiceStrategy.setOptions(opts)
-    })
+    }
   }
 }