Package com.atlassian.bitbucket.scm
Interface Watchdog
public interface Watchdog
Interface describing a watchdog which is used to manage a running process.
The watchdog helps prevent runaway processes by implementing an internal timer which kills the running process if it is left untouched too long.
- Since:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the running process.boolean
Retrieves a flag indicating whether the process has been canceled.void
Resets the internal timer, which is used to track whether a process's handlers are idle or not and prevent the idle timeout from terminating the process.
-
Method Details
-
cancel
void cancel()Cancels the running process. -
isCanceled
boolean isCanceled()Retrieves a flag indicating whether the process has been canceled.- Returns:
true
if the process has been canceled; otherwise,false
-
resetWatchdog
void resetWatchdog()Resets the internal timer, which is used to track whether a process's handlers are idle or not and prevent the idle timeout from terminating the process.Note that the watchdog is reset automatically when a
input handler
writes to the process stdin or when theoutput handler
orerror handler
reads from the process stdout or stderr.As a result, most handlers do not need to explicitly reset the watchdog. This method exists to allow handlers, which do lengthy processing in between accessing the
OutputStream
, to prevent idle timeouts by manually resetting the watchdog.
-