Wrapper around a subprocess.Popen instance. Returned by ProcessorI
when a job is submitted. This implementation uses the given interpreter
to call a file that must be named "script" in the generated
temporary directory.
The properties argument is used to generate the ./config file.
The params argument may be null in which case this process is being
used solely to calculate the parameters for the script
("omero.scripts.parse=true")
If iskill is True, then on cleanup, this process will reap the
attached session completely.
|
__init__(self,
ctx,
interpreter,
properties,
params,
iskill=False,
Popen=subprocess.Popen,
callback_cast=omero.grid.ProcessCallbackPrx.uncheckedCast,
omero_home=path.getcwd())
Popen and callback_Cast are primarily for testing. |
source code
|
|
|
|
|
|
|
make_config(self)
Creates the ICE_CONFIG file used by the client. |
source code
|
|
|
|
|
activate(self)
Process creation has to wait until all external downloads, etc are
finished. |
source code
|
|
|
deactivate(self)
Cleans up the temporary directory used by the process, and terminates
the Popen process if running. |
source code
|
|
|
|
|
wasActivated(self)
Returns true only if this instance has either a non-null popen or a
non-null rcode field. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
cleanup(self)
Deactivates the process (if active) and cleanups the server
connection. |
source code
|
|
|
cleanup_output(self)
Flush and close the stderr and stdout streams. |
source code
|
|
|
set_job_status(self,
client)
Sets the job status |
source code
|
|
|
|
|
_upload(self,
client,
filename,
name,
format) |
source code
|
|
|
|
|
|
|
poll(self,
current=None)
Checks popen.poll() (if active) and notifies all callbacks if
necessary. |
source code
|
|
|
wait(self,
current=None)
Waits on popen.wait() to return (if active) and notifies all
callbacks. |
source code
|
|
|
_term(self)
Attempts to cancel the process by sending SIGTERM (or similar) |
source code
|
|
|
|
|
cancel(self,
current=None)
Tries to cancel popen (if active) and notifies callbacks. |
source code
|
|
|
|
|
shutdown(self,
current=None)
If self.popen is active, then first call cancel, wait a period of
time, and finally call kill. |
source code
|
|
|
|
|
|
|
|
|
|
Inherited from util.SimpleServant :
setProxy
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|
|
omero_home
Location for OMERO_HOME/lib/python
|
|
interpreter
Executable which will be used on the script
|
|
properties
Properties used to create an Ice.Config
|
|
params
JobParams for this script.
|
|
iskill
Whether or not, cleanup should kill the session
|
|
Popen
Function which should be used for creating processes
|
|
callback_cast
Function used to cast all ProcessCallback proxies
|
|
rcode
return code from popen
|
|
callbacks
dictionary from id strings to callback proxies
|
|
popen
process.
|
|
pid
pid of the process.
|
|
started
time the process started
|
|
stopped
time of deactivation
|
|
final_status
status which will be sent on set_job_status
|
|
uuid
session this instance is tied to
|