Simple wrapper for nodejs cluster
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
README.md
index.js
package.json

README.md

cluster-node

Very simple clustering wrapper for nodejs

// app.js

require('cluster-node')(workers=4);
	
if(cluster.isWorker){
	 		var 	express = require('express'),  
				app = express(),
				server = require('http').createServer(app)
				server.listen(3000, function() {
						        //console.log('Server listening on 3000');
		        } );
				
				app.all('*', function(q,s,n){
					s.end('Hi world - served by process '+cluster.worker.id);
				})
}