added simple clustering master

This commit is contained in:
Brian Gough 2015-01-07 10:33:55 +00:00
parent 79292b4602
commit e03ee96216
3 changed files with 12 additions and 2 deletions

View file

@ -14,7 +14,7 @@ module.exports = (grunt) ->
app_server:
expand: true,
flatten: false,
src: ['app.coffee'],
src: ['app.coffee', 'cluster.coffee'],
dest: './',
ext: '.js'
@ -36,7 +36,7 @@ module.exports = (grunt) ->
watch:
server_coffee:
files: ['app/*.coffee','app/**/*.coffee', 'test/unit/coffee/**/*.coffee', 'test/unit/coffee/*.coffee', "app.coffee"]
files: ['app/*.coffee','app/**/*.coffee', 'test/unit/coffee/**/*.coffee', 'test/unit/coffee/*.coffee', "app.coffee", "cluster.coffee"]
tasks: ["clean", 'coffee', 'mochaTest']
clean: ["app/js", "test/unit/js", "app.js"]

View file

@ -0,0 +1,9 @@
recluster = require "recluster" # https://github.com/doxout/recluster
path = require "path"
cluster = recluster path.join(__dirname, 'app.js'), {
workers: 2,
backoff: 0,
readyWhen: "listening"
}
cluster.run()

View file

@ -20,6 +20,7 @@
"node-transloadit": "0.0.4",
"node-uuid": "~1.4.1",
"pngcrush": "0.0.3",
"recluster": "^0.3.7",
"request": "2.14.0",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#master",
"stream-buffers": "~0.2.5",