/
githubmirror
/
pm2
Обзор
Документация
Войти
/
githubmirror
/
pm2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v6.0.9
examples/misc-examples/programmatic.js
39 строк
642 B
Unitech
Update README.md and fully restructure tests
24 янв 2018, 14:43
24 янв 2018, 14:43
dcd190b
Код
Авторство
О чём код?
var pm2 = require('..'); pm2.connect(function() { pm2.start('echo.js', function() { setInterval(function() { pm2.restart('echo', function() { }); }, 2000); }); }); pm2.launchBus(function(err, bus) { console.log('connected', bus); bus.on('log:out', function(data) { if (data.process.name == 'echo') console.log(arguments); }); bus.on('reconnect attempt', function() { console.log('Bus reconnecting'); }); bus.on('close', function() { console.log('Bus closed'); }); }); /** * Exiting */ //pm2.disconnectBus(); // For Bus system //pm2.disconnect(); // For RPC connection