Easy cluster management + zero downtime deploys & reloads
Basic cluster management in one line:
return if require'cluster_master'runMaster# worker's code here
By default it'll spawn
os.cpus().length workers and respawn every dead worker.
Out of box you'll get safe zero downtime reload:
For more stuff see source.
Oops! Seems like forever still does not have proper support for specifying kill signal.
However you can specify pid file for ClusterMaster and hups yourself:
return if require('cluster_master').runMaster(pidfile: 'pids/cluster.pid')
May be later: Once cluster is started with forever
forever start -c coffee server.coffee
it can be reloaded with
forever stop --killSignal SIGHUP -c coffee server.coffee