common
common
JobState
dataclass
The state of a job which keeps its state (see RedisStateProtocol) as
it was read from the job hash. It gives the dispatcher one thing to hand
over instead of the raw redis fields.
Attributes:
-
id(str) –The unique identifier of the job.
-
status(Status) –The current status of the job.
-
last_update(str | None) –ISO timestamp of the last status change.
-
result(JobResult | None) –The result of a succeeded job.
-
message(str | None) –The error message of a failed job, or why a dismissed one stopped.
-
progress(int | None) –The percentage (0-100) the job reported last,
Noneif it reported none (yet).
Source code in src/qgis_server_light/interface/dispatcher/common.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
finished: bool
property
If the job reached a final status, nothing changes on it anymore.
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
last_update: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
message: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
progress: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
result: JobResult | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
status: Status = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, status: Status, last_update: str | None = None, result: JobResult | None = None, message: str | None = None, progress: int | None = None) -> None
Status
Bases: Enum
Source code in src/qgis_server_light/interface/dispatcher/common.py
9 10 11 12 13 14 | |
DISMISSED = 'dismissed'
class-attribute
instance-attribute
FAILURE = 'failed'
class-attribute
instance-attribute
QUEUED = 'queued'
class-attribute
instance-attribute
RUNNING = 'running'
class-attribute
instance-attribute
SUCCESS = 'succeed'
class-attribute
instance-attribute
Worker
dataclass
A worker the dispatcher has seen alive on the queue. It carries what a consumer needs to tell whether jobs can be served and what the worker is doing right now.
Attributes:
-
id(str) –The unique identifier of the worker.
-
last_seen(datetime) –The time of the last heartbeat of the worker, always timezone aware.
-
info(EngineInfo) –The info the worker published with its last heartbeat (status, QGIS version, start time).
Source code in src/qgis_server_light/interface/dispatcher/common.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |