JobResult#

class safir.arq.JobResult(id, name, args, kwargs, enqueue_time, status, queue_name, start_time, finish_time, success, result)#

Bases: JobMetadata

The full result of a job, as well as its metadata.

id#

The Job identifier

Type:

str

name#

The task name.

Type:

str

args#

The positional arguments to the task function.

Type:

Any

kwargs#

The keyword arguments to the task function.

Type:

Any

enqueue_time#

Time when the job was added to the queue.

Type:

datetime.datetime

status#

Status of the job.

States are defined by the arq.jobs.JobStatus enumeration:

  • deferred (in queue, but waiting a predetermined time to become ready to run)

  • queued (queued to run)

  • in_progress (actively being run by a worker)

  • complete (result is available)

  • not_found (the job cannot be found)

Type:

str

start_time#

Time when the job started.

Type:

datetime.datetime

finish_time#

Time when the job finished.

Type:

datetime.datetime

success#

True if the job returned without an exception, False if an exception was raised.

Type:

bool

result#

The job’s result.

Type:

Any

Parameters:

Methods Summary

from_job(job)

Initialize the JobResult from an arq Job.

Methods Documentation

async classmethod from_job(job)#

Initialize the JobResult from an arq Job.

Raises:
Parameters:

job (Job) –

Return type:

JobResult