Closed sandinmyjoints closed 11 years ago
For some reason the tests don't catch this right now, but its sometimes unsafe to use worker.send
there directly - that is, when the worker completely fails to run and establish an IPC channel (e.g. syntax errors)
Because of that I wrapped worker.send
in an empty try/catch block.
I also added a brief section on worker cleanup in the readme.
Also, you should now have push access to this repository: In the next couple of weeks I'm going to be busy with a particularly gnarly problem in our company's project so I might not have enough time for recluster :)
Cool hack :) -- thanks!
Here is the PR for #9. My only concern here is that I am sending
send
ing a message immediately before callingdisconnect
. Is there a chance that disconnect will close the IPC channel before the message is sent/delivered? I don't think so, because I see this in child_process.js:So I think the channel will stay open until this message is delivered (if it is the only message -- if there's more than one in flight, maybe the channel will close before any after the first are delivered?).