This is a list of manually maintained changes and updates for each version.
None
None
None
None
None
None
None
None
None
None
None
None
None
None
var cluster = require('cluster-mode');
cluster.start(config, function () {
// process is now ready
});
None
None
None
None
None
None
None
None
None
None
None
Version 0.2.0
None
The porcess was not exiting with exit code 1 when an error object is passed.
None
None
Version 0.0.12
None
None
None
Version 0.0.11
None
None
Version 0.0.10
Sends a message object to a specific worker process.
The sent message can be caught by message
event in the targeted worker process.
The event is emitted when the process recieves a message object from another cluster process by .send()
.
The callback will be passed the message object.
Message Object Structure:
{
from: <worker ID>/<string "master">
msg: <message data>
}
Example Code:
var cluster = require('cluster-mode');
cluster.on('message', function (data) {
console.log('message was sent from', data.from);
console.log('sent message is', data.msg);
});
Emitted when worker map is synced.
The callback will be passed the worker map (Same map as .getWorkers() would return).
NOTE: If sync
option is set to false
in the configuration object for .start()
, the event will NOT be emitted.
Default Configurations
{
max: <number of CPU available>,
log: null,
autoSpawn: false,
sync: true
}
None
None
None
Version 0.0.9
None
None
Version 0.0.8
None
None
None
Version 0.0.7
With .stop()
, you can stop the process programatically.
None
None
None
Version 0.0.6
None
With the 2nd argument runOnMaster
set to false
, the shutdown task function(s) will NOT be executed on master process.
The default is true
.
None
None
Version 0.0.5
cluster
, `reload``
None
None
cluster.master.ready
, cluster.worker.ready
, cluster.non.ready
, auto.spawn
, reload.complete
, and exit
are added.
None
None
None
None
None
None
In cluster mode w/ autoSpawn = true: a worker dies in less than 10 seconds -> reload application process w/ SIGHUP -> terminate application process -> the application process does not die.
None
None
Very first released version. Please refer to README.