gws.base.job.worker¶
Base job worker.
Source code: gws.base.job.worker
Module Contents¶
- class gws.base.job.worker.Object(root: gws.Root, user: gws.User, job: gws.Job | None = None)¶
Base job worker.
Subclasses implement a
run(root, job)class method, which the job manager calls to run the job. A worker can also run without a job, then job updates are skipped.- root¶
- get_job() gws.Job | None¶
Return the current state of the job.
- Returns:
The job, or
Noneif the worker runs without a job.- Raises:
gws.JobTerminated – If the job no longer exists or is not running, e.g. because it was cancelled.
- update_job(**kwargs)¶
Update the job record. Does nothing if the worker runs without a job.
- Parameters:
**kwargs – Job fields to update, e.g.
state,step,numSteps,stepNameorresult.- Raises:
gws.JobTerminated – If the job no longer exists or is not running.