opts: WorkerOptions = {}
) {
super(
- 'worker-cluster-pool:poolifier',
+ 'poolifier:cluster-worker',
cluster.isPrimary,
cluster.worker as Worker,
taskFunctions,
this.getMainWorker().on('message', this.messageListener.bind(this))
this.sendToMainWorker({
ready: true,
- taskFunctions: this.listTaskFunctions(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
} catch {
this.sendToMainWorker({
ready: false,
- taskFunctions: this.listTaskFunctions(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
}
}
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
- this.getMainWorker().send(message)
+ this.getMainWorker().send({ ...message, workerId: this.id })
}
}