# Class: Process

## vertx-shell-js/process~ Process

#### new Process()

A process managed by the shell.

Source:
  - vertx-shell-js/process.js, line 31

### Methods

#### exitCode() → {number}

Source:
  - vertx-shell-js/process.js, line 57

##### Returns:

- the process exit code when the status is otherwise `null`
- Type
    number

#### getSession() → {Session}

Source:
  - vertx-shell-js/process.js, line 118

##### Returns:

- the process session
- Type
    Session

#### getTty() → {Tty}

Source:
  - vertx-shell-js/process.js, line 86

##### Returns:

- the process tty
- Type
    Tty

#### interrupt(completionHandler) → {boolean}

Attempt to interrupt the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called after interrupt callback

Source:
  - vertx-shell-js/process.js, line 172

##### Returns:

true if the process caught the signal

Type
  boolean

#### resume(foreground, completionHandler)

Suspend the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`foreground` | boolean |
`completionHandler` | function | handler called after resume callback

Source:
  - vertx-shell-js/process.js, line 188

#### run(foregraound, completionHandler)

Run the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`foregraound` | boolean |
`completionHandler` | function | handler called after process callback

Source:
  - vertx-shell-js/process.js, line 152

#### setSession(session) → {Process}

Set the process session

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | Session | the process session

Source:
  - vertx-shell-js/process.js, line 103

##### Returns:

this object

Type
  Process

#### setTty(tty) → {Process}

Set the process tty.

##### Parameters:

Name | Type | Description
--- | --- | ---
`tty` | Tty | the process tty

Source:
  - vertx-shell-js/process.js, line 71

##### Returns:

this object

Type
  Process

#### status() → {Object}

Source:
  - vertx-shell-js/process.js, line 43

##### Returns:

- the current process status
- Type
    Object

#### suspend(completionHandler)

Resume the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called after suspend callback

Source:
  - vertx-shell-js/process.js, line 207

#### terminate(completionHandler)

Terminate the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called after end callback

Source:
  - vertx-shell-js/process.js, line 222

#### terminatedHandler(handler) → {Process}

Set an handler for being notified when the process terminates.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the handler called when the process terminates.

Source:
  - vertx-shell-js/process.js, line 135

##### Returns:

this object

Type
  Process

#### toBackground(completionHandler)

Set the process in background.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called after background callback

Source:
  - vertx-shell-js/process.js, line 237

#### toForeground(completionHandler)

Set the process in foreground.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called after foreground callback

Source:
  - vertx-shell-js/process.js, line 252