jade.jobs.async_job_interface.AsyncJobInterface

class jade.jobs.async_job_interface.AsyncJobInterface[source]

Bases: ABC

Defines interface for async jobs.

Methods

cancel()

Cancel the job.

get_blocking_jobs()

Return the job names blocking this job.

get_id()

Return the ID of the job.

is_complete()

Return True if the job is complete.

remove_blocking_job(name)

Remove the name from the job's blocking list.

run()

Run the job.

set_blocking_jobs(jobs)

Set the blocking jobs.

Attributes

cancel_on_blocking_job_failure

Cancel the job if a blocking job fails.

name

Return the job name.

return_code

Returns the return code of the job.

abstract cancel()[source]

Cancel the job.

abstract property cancel_on_blocking_job_failure

Cancel the job if a blocking job fails.

abstract get_id()[source]

Return the ID of the job.

Return type:

int

abstract is_complete()[source]

Return True if the job is complete.

Note: this must be called until the job actually completes.

Return type:

bool

Raises:

ExecutionError – Raised if statuses cannot be retrieved.

abstract property name

Return the job name.

Return type:

str

abstract property return_code

Returns the return code of the job.

Returns:

0 means success, otherwise failure

Return type:

int

abstract run()[source]

Run the job.

Returns:

Returns GOOD if the job was successfully started.

Return type:

Status

abstract get_blocking_jobs()[source]

Return the job names blocking this job.

Returns:

Empty set means that the job is not blocked.

Return type:

set

abstract remove_blocking_job(name)[source]

Remove the name from the job’s blocking list.

Parameters:

name (str) – name of job that is now finished

abstract set_blocking_jobs(jobs)[source]

Set the blocking jobs.

Parameters:

jobs (set) – names that are blocking