+ if (this.opts.enableTasksQueue === true) {
+ return (
+ this.workerNodes.findIndex(
+ (workerNode) =>
+ workerNode.info.ready &&
+ workerNode.usage.tasks.executing <
+ (this.opts.tasksQueueOptions?.concurrency as number)
+ ) === -1
+ )
+ } else {
+ return (
+ this.workerNodes.findIndex(
+ (workerNode) =>
+ workerNode.info.ready && workerNode.usage.tasks.executing === 0
+ ) === -1
+ )
+ }
+ }
+
+ /** @inheritDoc */
+ public listTaskFunctions (): string[] {
+ for (const workerNode of this.workerNodes) {
+ if (
+ Array.isArray(workerNode.info.taskFunctions) &&
+ workerNode.info.taskFunctions.length > 0
+ ) {
+ return workerNode.info.taskFunctions
+ }
+ }
+ return []