# 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 55

##### Returns:

the process exit code when the status is otherwise `null`

Type
  number

#### getSession() → {Session}

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

##### Returns:

the process session

Type
  Session

#### getTty() → {Tty}

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

##### 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 164

##### 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 180

#### run(foregraound)

Run the process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`foregraound` | boolean |

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

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

Set the process session

##### Parameters:

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

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

##### 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 69

##### Returns:

this object

Type
  Process

#### status() → {Object}

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

##### 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 199

#### terminate(completionHandler)

Terminate the process.

##### Parameters:

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

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

#### 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 131

##### 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 229

#### 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 244