diff --git a/examples/child.js b/examples/child.js new file mode 100644 index 0000000..b152e72 --- /dev/null +++ b/examples/child.js @@ -0,0 +1,13 @@ +require('watcher')({ + maxMemory:25000 //25mb +}) + + +/* + + app.code + + + + + */ \ No newline at end of file diff --git a/examples/master.js b/examples/master.js new file mode 100644 index 0000000..547aee1 --- /dev/null +++ b/examples/master.js @@ -0,0 +1,16 @@ +var bolt = require('bolt'); +var restart = require('lib/app').restart; +var mesh = new bolt.Node({ + delimiter:'::', + host: options.host || 'localhost', + port: options.port || 6379, + auth: options.auth || '' +}); +mesh.on('nodester::dieing',function(app){ + var proxytable =require('/path/to/proxy/table.json') + for (subdomain in proxytable){ + if (proxytable[subdomain]===app.port){ + restart(proxytable[subdomain]); + } + } +}) \ No newline at end of file