Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Thread

Handles the cleanup and restart of the command executer.

Kills the spawned process, kills the process running on the port to avoid conflicts and restarts a clean process.

Hierarchy

Index

Constructors

constructor

Properties

Private args

args: string[] = []

The arguments derived from config.exec which is passed to childProcess of this instance.

Private childProcess

childProcess: ChildProcessWithoutNullStreams = null

The child process generated using child_process.spawn.

Private command

command: string = null

The main command derived from config.exec which is passed to childProcess of this instance.

Protected config

config: Config

The Config object provided to this instance.

Protected display

display: Display

The Display instance which allows displaying user configued messages.

Protected log

log: Logger

The Logger instance which allows various log types based on level.

Methods

Private killPort

  • killPort(): Promise<void>
  • Try to kill the process running on the port specified in config.port. If not, fail silently.

    Returns Promise<void>

Private killProcess

  • killProcess(): Promise<void>

restart

  • restart(root: string): Promise<void>
  • Restart the thread, executing the command specified in config.exec.

    Parameters

    • root: string

      The root path to start the process.

    Returns Promise<void>

start

  • start(root: string, restart?: boolean): Promise<void>
  • Start the thread, executing the command specified in config.exec.

    Parameters

    • root: string

      The root path to start the process.

    • Default value restart: boolean = false

    Returns Promise<void>

Generated using TypeDoc