A
A
Alexander Wolf2014-02-13 01:20:20
Node.js
Alexander Wolf, 2014-02-13 01:20:20

Why is forever needed if there is a Cluster?

Hello! Please tell me how forever differs from this method:

var cluster = require('cluster');

if (cluster.isFork) require('./server');
else {
  cluster.on('exit', function () {
    console.error('Кирдык. Сервер упал. Поднимаем..');
    cluster.fork();
  });
  cluster.on('fork', function () {
    console.log('Сервер запущен и работает!');
  });
  cluster.fork();
}

For me, this way is better (and in the future it is easier to scale).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zxmd, 2014-02-13
@mannaro

Well, how can I tell you. If it's easier for you, then use no health.
It's easier for me forever start nameapp.js - without integrating forever itself into the program code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question