The cluster modules in nodejs has the exit, disconnect, and death events. Which functions should the worker invoke in order to issue such events?
I have tried cluster.worker.X() where is is either close, end, diconnect, etc.
with the same breath, how to issue end event for the http.createServer()?
thanks
I don't believe these events should be invoked directly. They exists for us to be able to react to events in the lifecycle of the cluster. Here's how to indirectly invoke them:
exit
// from the worker
process.exit()
disconnect
// from the master
var worker = cluster.fork()
worker.disconnect()
death (deprecated)
Renamed to 'exit' in v0.8.0 (see above).