Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-cluster...
[poolifier.git] / src / worker / abstract-worker.ts
index b8e4b167602dd14306b595d0f1564b13009f636c..22e65bad63d213aa6b1bda6f0adc6a2a76401873 100644 (file)
@@ -100,7 +100,8 @@ export abstract class AbstractWorker<
     this.checkTaskFunctions(taskFunctions)
     this.checkWorkerOptions(this.opts)
     if (!this.isMain) {
-      this.getMainWorker().once('message', this.handleReadyMessage.bind(this))
+      // Should be once() but Node.js on windows has a bug that prevents it from working
+      this.getMainWorker().on('message', this.handleReadyMessage.bind(this))
     }
   }