Home | Trees | Indices | Help |
|
---|
|
object --+ | UWS
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.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Class Variables | |
cleanupInterval = 43200
|
|
joblistPreamble =
hash(x) |
|
jobdocPreamble =
hash(x) |
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
runs the canned statement statementId with args through the DB connection conn. This will return row dictionaries of the result if there is a result. |
creates a new job and returns its id. kws can be properties of the new job or the special key timeout giving after how many seconds we should give up trying to lock the db. |
returns the id of a new TAP job created from request. Request has to be a nevow request or similar, with request arguments in request.args. This calls setParamsFromRequest(wjob, request) to do the actual work; this latter method is what individual UWSes should override. |
returns a read-only UWSJob for jobId. Note that by the time you do something with the information here, the "true" state in the database may already be different. There should be no way to write whatever information you have in here, so any "racing" here shouldn't hurt. |
a context manager for job manipulation. This is done such that any changes to the job's properties within the controlled section get propagated to the database. As long as you are in the controlled section, nobody else can change the job.
|
removes the job with jobId from the UWS. This calls the job's prepareForDestruction method while the job is writable. |
returns pairs for id and phase for all jobs in the UWS. phase, last, after are the respective parameters from UWS 1.1. |
removes expired jobs from the UWS jobs table. The constructor arranged for this to be called now and then (cleanupFrequency class attribute, defaulting to 12*3600). The functionality is also exposed through gavo admin cleanuws; this also lets you use the includeFailed and includeCompleted flags. These should not be used on production services since you'd probably nuke jobs still interesting to your users. |
returns the handling URL for the job with jobId. You must override this in deriving classes. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |