cluster.worker as Worker,
opts
)
- if (!this.isMain) {
- this.sendToMainWorker({ workerId: this.id, started: true })
- }
}
/** @inheritDoc */
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
- console.log('sending message to main worker(cluster)', message)
this.getMainWorker().send(message)
}
-
- /** @inheritDoc */
- protected handleError (e: Error | string): string {
- return e instanceof Error ? e.message : e
- }
}