repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: add worker info to worker nodes
[poolifier.git]
/
src
/
worker
/
cluster-worker.ts
diff --git
a/src/worker/cluster-worker.ts
b/src/worker/cluster-worker.ts
index 13735b1d697c076c547981e9d5aad8bd22633f84..16dddd2969bd50193c4fb43e762d607f08f4ca08 100644
(file)
--- a/
src/worker/cluster-worker.ts
+++ b/
src/worker/cluster-worker.ts
@@
-41,10
+41,19
@@
export class ClusterWorker<
cluster.worker as Worker,
opts
)
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<Response>): void {
}
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
+ console.log('sending message to main worker(cluster)', message)
this.getMainWorker().send(message)
}
this.getMainWorker().send(message)
}