a facade for a universal worker service (UWS).
You must construct it with the job class (see UWSJob) and a
uwsactions.JobActions instance
The UWS then provides methods to access the jobs table,
create jobs and and deserialize jobs from the jobs table.
We have a "statements cache" in here, where we used the UWS table
defintion to create query strings we can later pass to the database.
Don't worry about this any more. Just write text queries when adding
features. It's more readable and just about as stable against
code evolution.
You must override the getURLForId(jobId) method in your concrete
implementation.
You should also override jobdocPreamble and joblistPreamble. This
is raw XML that is prepended to job and list documents. This is primarily
for PIs giving stylesheets, but given we don't use doctypes you could
provide internal subsets there, too. Anyway, see the TAP UWS runner
for examples.
|
__init__(self,
jobClass,
jobActions)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
runCanned(self,
statementId,
args,
conn)
runs the canned statement statementId with args through the
DB connection conn. |
source code
|
|
|
|
|
|
|
|
|
getNewJob(self,
**kws)
creates a new job and returns a read-only instance for it. |
source code
|
|
|
|
|
changeToPhase(self,
jobId,
newPhase,
input=None,
timeout=0.1) |
source code
|
|
|
|
|
countRunningJobs(self)
returns the number of EXECUTING jobs in the jobsTable. |
source code
|
|
|
countQueuedJobs(self)
returns the number of QUEUED jobs in jobsTable. |
source code
|
|
|
getJobIds(self)
returns a list of all currently existing job ids. |
source code
|
|
|
getIdsAndPhases(self,
owner=None,
phase=None,
last=None,
after=None,
initFragments=None,
initPars=None)
returns pairs for id and phase for all jobs in the UWS. |
source code
|
|
|
cleanupJobsTable(self,
includeFailed=False,
includeCompleted=False,
includeAll=False,
includeForgotten=False)
removes expired jobs from the UWS jobs table. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|