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

##### Returns:

- the job id
- Type
    number

#### interrupt() → {boolean}

Attempt to interrupt the job.

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

##### Returns:

true if the job is actually interrupted

Type
  boolean

#### lastStopped() → {number}

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

##### Returns:

- when the job was last stopped
- Type
    number

#### line() → {string}

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

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

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

##### Returns:

Type
  Job

#### run() → {Job}

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

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

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

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

##### Returns:

this object

Type
  Job

#### status() → {Object}

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

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

##### Returns:

this object

Type
  Job

#### suspend() → {Job}

Resume the job.

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

##### Returns:

this object

Type
  Job

#### terminate()

Terminate the job.

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

#### toBackground() → {Job}

Send the job to background.

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

##### Returns:

this object

Type
  Job

#### toForeground() → {Job}

Send the job to foreground.

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

##### Returns:

this object

Type
  Job