+ /** @inheritDoc */
+ public abstract remove (workerNodeKey: number): boolean
+
+ /** @inheritDoc */
+ public setOptions (opts: WorkerChoiceStrategyOptions): void {
+ opts = opts ?? DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+ this.checkOptions(opts)
+ this.opts = opts
+ }
+
+ /**
+ * Finds a free worker node key.
+ *
+ * @returns The free worker node key or `-1` if there is no free worker node.
+ */
+ protected findFreeWorkerNodeKey (): number {
+ if (this.toggleFindLastFreeWorkerNodeKey) {
+ this.toggleFindLastFreeWorkerNodeKey = false
+ return this.pool.findLastFreeWorkerNodeKey()
+ }
+ this.toggleFindLastFreeWorkerNodeKey = true
+ return this.pool.findFreeWorkerNodeKey()
+ }