readonly numberOfRunningTasks: number
/**
- * Find a free worker based on the number of tasks the worker has applied.
+ * Finds a free worker based on the number of tasks the worker has applied.
*
* If a worker is found with `0` running tasks, it is detected as free and returned.
*
findFreeWorker(): Worker | false
/**
- * Get worker index.
+ * Gets worker index.
*
* @param worker The worker.
* @returns The worker index.
getWorkerIndex(worker: Worker): number
/**
- * Get worker running tasks.
+ * Gets worker running tasks.
*
* @param worker The worker.
* @returns The number of tasks currently running on the worker.
getWorkerRunningTasks(worker: Worker): number | undefined
/**
- * Get worker average tasks runtime.
+ * Gets worker average tasks runtime.
*
* @param worker The worker.
* @returns The average tasks runtime on the worker.
}
/**
- * Check if the `fn` parameter is passed to the constructor.
+ * Checks if the `fn` parameter is passed to the constructor.
*
* @param fn The function that should be defined.
*/
}
/**
- * Send a message to the main worker.
+ * Sends a message to the main worker.
*
* @param message The response message.
*/
}
/**
- * Handle an error and convert it to a string so it can be sent back to the main worker.
+ * Handles an error and convert it to a string so it can be sent back to the main worker.
*
* @param e The error raised by the worker.
* @returns Message of the error.
}
/**
- * Run the given function synchronously.
+ * Runs the given function synchronously.
*
* @param fn Function that will be executed.
* @param value Input data for the given function.
}
/**
- * Run the given function asynchronously.
+ * Runs the given function asynchronously.
*
* @param fn Function that will be executed.
* @param value Input data for the given function.