UNPKG

@omneedia/socketcluster

Version:

SocketCluster - A Highly parallelized WebSocket server cluster to make the most of multi-core machines/instances.

12 lines (10 loc) 346 B
var chokidar = require('chokidar'); module.exports.attach = function (scMasterInstance, options) { if (!options) { options = {}; } chokidar.watch('.', options).on('change', (filePath) => { console.log(' !! File ' + filePath + ' was modified. Restarting workers...'); scMasterInstance.killWorkers({immediate: true}); }); };