npm.io
1.0.1 • Published 7 years ago

ps-watchdog

Licence
MIT
Version
1.0.1
Deps
1
Size
7 kB
Vulns
0
Weekly
0

Ps-watchdog module

Kills the current process and all the children when the JavaScript event loop is busy for more than a configurable amount of time.

It forks a new process that waits for a periodical keepalive from the event loop.

Installing

npm install ps-watchdog

Using

import {Watchdog} from 'ps-watchdog';

const interval = 1000;
const times = 2;
const watchdog = new Watchdog(interval, times);
watchdog.start();

interval: keepalive interval in milliseconds
times: number of times the process can miss the keepalive before getting killed

License

MIT

Author

Alessio Paccoia <alessio.paccoia@cubbit.io>