Class NgrokProcess.ProcessMonitor

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    NgrokProcess

    public static class NgrokProcess.ProcessMonitor
    extends java.lang.Object
    implements java.lang.Runnable
    A Runnable that monitors the ngrok process.
    • Constructor Detail

      • ProcessMonitor

        public ProcessMonitor​(NgrokProcess ngrokProcess,
                              JavaNgrokConfig javaNgrokConfig)
        Construct to monitor a {link @Process} monitor.
        Parameters:
        ngrokProcess - The Process to monitor.
        javaNgrokConfig - The config to use when monitoring the Process.
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • isMonitoring

        public boolean isMonitoring()
        Whether the thread is continuing to monitor ngrok logs.
      • stop

        public void stop()
        Set the monitor thread to stop monitoring the ngrok process after the next log event. This will not necessarily terminate the process immediately, as the process may currently be idle, rather it sets a flag on the thread telling it to terminate the next time it wakes up.

        This has no impact on the ngrok process itself, only java-ngrok's monitor of the process and its logs.