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.
- Parameters:
Attributes Summary
The positional arguments to the task function.
Time when the job was added to the queue.
Time when the job finished.
The
Job
identifier.The keyword arguments to the task function.
The task name.
Name of the queue this job belongs to.
The job's result.
Time when the job started.
Status of the job.
True
if the job returned without an exception,False
if an exception was raised.Methods Summary
from_job
(job)Attributes Documentation
-
args:
tuple
[Any
,...
] = <dataclasses._MISSING_TYPE object>¶ The positional arguments to the task function.
-
enqueue_time:
datetime
= <dataclasses._MISSING_TYPE object>¶ Time when the job was added to the queue.
-
kwargs:
dict
[str
,Any
] = <dataclasses._MISSING_TYPE object>¶ The keyword arguments to the task function.
-
status:
JobStatus
= <dataclasses._MISSING_TYPE object>¶ 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)
-
success:
bool
= <dataclasses._MISSING_TYPE object>¶ True
if the job returned without an exception,False
if an exception was raised.
Methods Documentation
- async classmethod from_job(job)¶
Initialize the
JobResult
from an arqJob
.- Raises:
JobNotFound – Raised if the job is not found
JobResultUnavailable – Raised if the job result is not available.
- Parameters:
job (
Job
)- Return type:
Self