docs: refine worker choice strategies ToC
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 10 Sep 2023 11:06:01 +0000 (13:06 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 10 Sep 2023 11:06:01 +0000 (13:06 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
docs/worker-choice-strategies.md
src/pools/abstract-pool.ts

index d06ef8e0fb5be8b0f3679fa74a17e3c3b1da67f5..bd5f9e2bfc58d1aeef798ef659a84e9305a87ca5 100644 (file)
@@ -7,7 +7,7 @@ All duration or timestamp are expressed in milliseconds.
 - [Strategies](#strategies)
   - [Fair share](#fair-share)
   - [Weighted round robin](#weighted-round-robin)
-  - [Interleaved weighted round robin](#interleaved-weighted-round-robin-experimental)
+  - [Interleaved weighted round robin (experimental)](#interleaved-weighted-round-robin-experimental)
 - [Statistics](#statistics)
   - [Simple moving median](#simple-moving-median)
 
index fea2e3a1f4cec5b5c8f6187515f707524dc41dfe..3dcbceaba1bfb6012f98c80c73f81a332f80e468 100644 (file)
@@ -772,14 +772,13 @@ export abstract class AbstractPool<
       }
       const timestamp = performance.now()
       const workerNodeKey = this.chooseWorkerNode()
-      const workerInfo = this.getWorkerInfo(workerNodeKey)
       const task: Task<Data> = {
         name: name ?? DEFAULT_TASK_NAME,
         // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
         data: data ?? ({} as Data),
         transferList,
         timestamp,
-        workerId: workerInfo.id as number,
+        workerId: this.getWorkerInfo(workerNodeKey).id as number,
         taskId: randomUUID()
       }
       this.promiseResponseMap.set(task.taskId as string, {