Enable two way communication with worker using Event Emitter pattern#210
Enable two way communication with worker using Event Emitter pattern#210S0c5 wants to merge 1 commit intojosdejong:masterfrom
Conversation
Enable workers to communicate with the parent process using an EventEmitter, now the function handlers in the workers have `this.emit` `this.on` `this.once` to handle and emit messages.
|
Thanks David! So this PR implements #51, right? I will review your PR soon, all looks good and well tested at first sight. I see the tests fail on Node 10 with the following error though, can you have a look into that? See: https://travis-ci.org/github/josdejong/workerpool/jobs/746149617 |
|
Hello Jos, Yeah, this PR implements and closes the #51, I didn't have time to see what happens on node 10 but maybe I can check this weekend. Let me know if you have comments on my code. Regards. |
|
David I've just had a look at the API you've implemented for passing messages. Overall it looks good but I think we should align a bit more on the API.
|
Description
This PR enables 2-way communication between the main process with the task executed in the workers using an event emitter pattern, now we can listen and emit events 🔥