/**
* Worker message listener.
*
- * @param message - Message received.
+ * @param message - The received message.
*/
protected messageListener (message: MessageValue<Data, Data>): void {
if (message.workerId === this.id) {
}
/**
- * Starts the worker alive check interval.
+ * Starts the worker aliveness check interval.
*/
private startCheckAlive (): void {
this.lastTaskTimestamp = performance.now()
}
/**
- * Stops the worker alive check interval.
+ * Stops the worker aliveness check interval.
*/
private stopCheckAlive (): void {
this.aliveInterval != null && clearInterval(this.aliveInterval)
}
/**
- * Runs the given function synchronously.
+ * Runs the given task function synchronously.
*
* @param fn - Task function that will be executed.
* @param task - Input data for the task function.
}
/**
- * Runs the given function asynchronously.
+ * Runs the given task function asynchronously.
*
* @param fn - Task function that will be executed.
* @param task - Input data for the task function.