Process Watch Dog with Heartbeat Released!

It's nice to watch a process execution and kill frozen processes after timeout, but when a process is supplying data is not frozen even when it takes a long time.
Release 1.1.0 introduces a new process wrapper to send a heartbeat to reset the timeout explicitly or automatically with every read byte.


Putting a process into watching returns a process wrapper:

Process process = ...

ProcessWatchDog watchDog = new ProcessWatchDog();

WatchedProcess watchedProcess =, 1000);

Because the class WatchedProcess extends stadard Java class Process, we can do simply:

process =, 1000);

Now, a heartbeat will be sent every time we read from the process input stream:

InputStream is = process.getInputStream();
int b;
while ((b = != -1) {
    // heartbeat is sent implicitly with every successful call of `read()` 

To send a heartbeat explicitly, we can do it via the WatchedProcess object:


Or simply tell the Watch Dog to do it:

watchDog.heartBeat(process);   // we don't need the `WatchedProcess` object here

Previous post about the Watch Dog: Process Watch Dog Released!

All about:

Happy heartbeating!