Miss any of our Open RFC calls?Watch the recordings here! »

hot-restart

0.1.0 • Public • Published

hot-restart

NPM version Build Status

hot restart a node server in cluster mode.

Install

npm install hot-restart

Usage

in master:

var restarter = require('hot-restart')();

restarter.on('restart', fuction () {
  // fork new workers
});

// when new work forked
restarter.add(newWorker);

// when old work died
restarter.remove(oldWorker);

in worker:

var restarter = require('hot-restart/worker');

restarter({
  disconnectTime: 1000,
  exitTime: 2000
});

use signal to hot restart the server: kill -PIPE 3132

checkout the example.

License

MIT

Install

npm i hot-restart

DownloadsWeekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar