* Message port used to communicate with the main worker.
*/
private port?: MessagePort
+
/**
* Constructs a new poolifier thread worker.
*
}
/** @inheritDoc */
- protected sendToMainWorker (message: MessageValue<Response>): void {
+ protected readonly sendToMainWorker = (
+ message: MessageValue<Response>
+ ): void => {
this.port?.postMessage({ ...message, workerId: this.id })
}