Object representing an external process task

Properties

isRunning

boolean

Check if the task is currently running

pid

Int32

The process ID of the running task

environment

{[key: string]: string}

The environment variables for the task

workingDirectory

string

The working directory for the task

terminationStatus

NSNumber

The termination status of the task

terminationReason

string

The termination reason

Methods

start()

Start the task

Parameters

None

Returns

HSTask - The task object for chaining

terminate()

Terminate the task (send SIGTERM)

Parameters

None

Returns

Nothing

kill9()

Terminate the task with extreme prejudice (send SIGKILL)

Parameters

None

Returns

Nothing

interrupt()

Interrupt the task (send SIGINT)

Parameters

None

Returns

Nothing

pause()

Pause the task (send SIGSTOP)

Parameters

None

Returns

Nothing

resume()

Resume the task (send SIGCONT)

Parameters

None

Returns

Nothing

waitUntilExit()

Wait for the task to complete (blocking)

Parameters

None

Returns

Nothing

sendInput(data)

Write data to the task's stdin

Parameters

  • data string

    The string data to write

Returns

Nothing

closeInput()

Close the task's stdin

Parameters

None

Returns

Nothing