X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fcluster-worker.ts;h=16dddd2969bd50193c4fb43e762d607f08f4ca08;hb=f59e102739e13698f278f1d9d58ab26ed8150442;hp=13735b1d697c076c547981e9d5aad8bd22633f84;hpb=3c93feb918b47943d801029fad82a61469e40127;p=poolifier.git diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index 13735b1d..16dddd29 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -41,10 +41,19 @@ export class ClusterWorker< cluster.worker as Worker, opts ) + if (!this.isMain) { + this.sendToMainWorker({ workerId: this.id, started: true }) + } + } + + /** @inheritDoc */ + protected get id (): number { + return this.getMainWorker().id } /** @inheritDoc */ protected sendToMainWorker (message: MessageValue): void { + console.log('sending message to main worker(cluster)', message) this.getMainWorker().send(message) }