Clustering
A small cluster module with a plugin system
Install
npm install clustering
Usage
var clustering = ; ifclusteringside == 'master' clustering ifclusteringside == 'worker' yourServer
And that will create a cluster running yourServer
.
You can also use
a plugin
EG. use(clustering.watch())
(watches all files that are loaded)
API
use(plugin(Cluster))
=> Use a plugin (execute it passing in the cluster)reload(full = false)
=> Reload the workers, if full is true then also reload the masterkill(signal = 'SIGKILL')
=> Killall the workers with signalside
=> 'master' if it's the master, 'worker' if it's a worker
Plugins
watch(full = true)
=> Automatically reload the clusterfull
=> Whether or not to to a full restart