BaseJob

class BaseJob(backend, job_id)[source]

Legacy Class to handle asynchronous jobs

Initializes the asynchronous job.

Parameters
  • backend (BaseBackend) – the backend used to run the job.

  • job_id (str) – a unique id in the context of the backend used to run the job.

Methods

BaseJob.backend()

Return the backend where this job was executed.

BaseJob.cancel()

Attempt to cancel the job.

BaseJob.cancelled()

Return whether the job has been cancelled.

BaseJob.done()

Return whether the job has successfully run.

BaseJob.in_final_state()

Return whether the job is in a final job state.

BaseJob.job_id()

Return a unique id identifying the job.

BaseJob.result()

Return the results of the job.

BaseJob.running()

Return whether the job is actively running.

BaseJob.status()

Return the status of the job, among the values of JobStatus.

BaseJob.submit()

Submit the job to the backend for execution.

BaseJob.wait_for_final_state([timeout, …])

Poll the job status until it progresses to a final state such as DONE or ERROR.