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