Adds support for the cluster core API.
Add support for Node's
cluster core API. Spawn many processes using only the master to access Medea.
To add support for clusters, just
var Medea = require'medea';var clusterify = require'medea-clusterify';var MedeaCluster = clusterifyMedea;var medea = ;
To start cluster mode, run
medea.setupMaster in the master process.
if clusterisMastermedeasetupMaster;// Go about your forking...
To use Medea from worker processes, it's business as usual.
medeaopenmedeaget'favorite_nacho_topping'console.logvaltoString; // probably 'jalapenos';;
Note that if you're doing a new
require('medea') in worker processes, you may need to reclusterify.