+ private setWorker (
+ workerKey: number,
+ worker: Worker,
+ tasksUsage: TasksUsage
+ ): void {
+ this.workers.set(workerKey, {
+ worker,
+ tasksUsage
+ })
+ }
+
+ /**
+ * Checks if the given worker is registered in the pool.
+ *
+ * @param worker - Worker to check.
+ * @returns `true` if the worker is registered in the pool.
+ */
+ private checkWorker (worker: Worker): boolean {
+ if (this.getWorkerKey(worker) == null) {
+ throw new Error('Worker could not be found in the pool')
+ }
+ return true