// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new Error(`Worker ${workerId?.toString()} failed to initialize`)
}
+ const maxPoolSize =
+ this.maximumNumberOfWorkers ?? this.minimumNumberOfWorkers
+ for (const taskFunctionProperties of taskFunctionsProperties ?? []) {
+ checkValidWorkerNodeKeys(
+ taskFunctionProperties.workerNodeKeys,
+ maxPoolSize
+ )
+ }
const workerNodeKey = this.getWorkerNodeKeyByWorkerId(workerId)
const workerNode = this.workerNodes[workerNodeKey]
workerNode.info.ready = ready
* Restricts task execution to specified worker nodes by their indices.
* Must contain valid indices within [0, pool max size - 1].
* If undefined, task can execute on any worker node.
- * @remarks `null` is not accepted here. Use `null` only via
- * {@link TaskFunctionProperties.workerNodeKeys} to clear affinity at runtime.
*/
workerNodeKeys?: number[]
}