# Class: Job

## vertx-shell-js/job~ Job

#### new Job()

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

### Methods

#### id() → {number}

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

##### Returns:

the job id

Type
  number

#### interrupt() → {boolean}

Attempt to interrupt the job.

Source:
  - vertx-shell-js/job.js, line 157

##### Returns:

true if the job is actually interrupted

Type
  boolean

#### lastStopped() → {number}

Source:
  - vertx-shell-js/job.js, line 68

##### Returns:

when the job was last stopped

Type
  number

#### line() → {string}

Source:
  - vertx-shell-js/job.js, line 81

##### Returns:

the execution line of the job, i.e the shell command line that launched this job

Type
  string

#### process() → {Process}

Source:
  - vertx-shell-js/job.js, line 245

##### Returns:

the first process in the job

Type
  Process

#### resume(foreground) → {Job}

Resume the job.

##### Parameters:

Name | Type | Description
--- | --- | ---
`foreground` | boolean | true when the job is resumed in foreground

Source:
  - vertx-shell-js/job.js, line 171

##### Returns:

Type
  Job

#### run() → {Job}

Run the job, before running the job a must be set.

Source:
  - vertx-shell-js/job.js, line 142

##### Returns:

this object

Type
  Job

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

Set a session on the job.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | Session | the session to use

Source:
  - vertx-shell-js/job.js, line 110

##### Returns:

this object

Type
  Job

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

Set a tty on the job.

##### Parameters:

Name | Type | Description
--- | --- | ---
`tty` | Tty | the tty to use

Source:
  - vertx-shell-js/job.js, line 95

##### Returns:

this object

Type
  Job

#### status() → {Object}

Source:
  - vertx-shell-js/job.js, line 55

##### Returns:

the job exec status

Type
  Object

#### statusUpdateHandler(handler) → {Job}

Set an handler called when the job terminates.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the terminate handler

Source:
  - vertx-shell-js/job.js, line 125

##### Returns:

this object

Type
  Job

#### suspend() → {Job}

Resume the job.

Source:
  - vertx-shell-js/job.js, line 218

##### Returns:

this object

Type
  Job

#### terminate()

Terminate the job.

Source:
  - vertx-shell-js/job.js, line 232

#### toBackground() → {Job}

Send the job to background.

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

##### Returns:

this object

Type
  Job

#### toForeground() → {Job}

Send the job to foreground.

Source:
  - vertx-shell-js/job.js, line 203

##### Returns:

this object

Type
  Job