parentPort as MessagePort,
opts
)
- if (!this.isMain) {
- this.sendToMainWorker({ workerId: this.id, started: true })
- }
}
protected get id (): number {
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
- console.log('sending message to main worker(thread)', message)
this.getMainWorker().postMessage(message)
}
+
+ /** @inheritDoc */
+ protected handleError (e: Error | string): string {
+ return e as string
+ }
}