Package gavo :: Package protocols :: Module uws :: Class ProcessBasedUWSTransitions
[frames] | no frames]

Class ProcessBasedUWSTransitions

source code

      object --+        
               |        
  UWSTransitions --+    
                   |    
SimpleUWSTransitions --+
                       |
                      ProcessBasedUWSTransitions
Known Subclasses:

A SimpleUWSTransistions that processes its stuff in a child process.

Inheriting classes must implement the getCommandLine(wjob) method -- it must return a command (suitable for reactor.spawnProcess and os.execlp and a list of arguments suitable for reactor.spawnProcess.

They must also implement some sort of queue management. The the simplest case, override queueJob and start the job from there (but set to QUEUED in there anyway).

Instance Methods
 
getCommandLine(self, wjob) source code
 
startJob(self, newState, wjob, ignored)
causes a process to be started that executes job.
source code
 
killJob(self, newState, wjob, ignored)
tries to kill/abort job.
source code

Inherited from SimpleUWSTransitions: __init__, completeJob, errorOutJob, ignoreAndLog, markAborted, queueJob

Inherited from UWSTransitions: flagError, getTransition, noOp, noteEndTime

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

startJob(self, newState, wjob, ignored)

source code 

causes a process to be started that executes job.

This dispatches according to whether or not we are within a twisted event loop, mostly for testing support.

killJob(self, newState, wjob, ignored)

source code 

tries to kill/abort job.

Actually, there are two different scenarios here: Either the job has a non-NULL startTime. In that case, the child job is in control and will manage the state itself. Then kill -INT will do the right thing.

However, if startTime is NULL, the child is still starting up. Sending a kill -INT may do many things, and most of them we don't want. So, in this case we kill -TERM the child, do state management ourselves and hope for the best.

Overrides: SimpleUWSTransitions.killJob