Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.on('uncaughtException', function(err) {
- console.log(err);
- });
- var forever = require('forever');
- var util = require('util');
- var chatServer = new (forever.Monitor)('forever.test.two.js')
- var hubServer = new (forever.Monitor)('forever.test.one.js')
- chatServer.on('start', function(process, data){
- util.puts('Chat : Started');
- });
- hubServer.on('start', function(process, data){
- util.puts('Hub : Started');
- });
- // If the Hub Server dies. we must restart the Chat Server
- hubServer.on('restart', function(code){
- util.puts('Hub : Restarted');
- chatServer.restart();
- });
- chatServer.on('restart', function(){
- util.puts('Chat : Restarted');
- });
- // If the Chat Server dies, just start that again
- chatServer.on('stop', function(){
- util.puts('Chat : Stopped');
- });
- hubServer.start();
- chatServer.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement