Trees | Indices | Help |
|
---|
|
object --+ | BaseJob --+ | ThreadedJob
This class is for jobs that don't run under job control yet can have significant computational requirements in the python part of the JobDJ process. For code run in separate processes, see the SubprocessJob class.
A ThreadedJob instance is run in a separate thread and so won't hold up execution of the main thread running the JobDJ instance. This allows additional jobs to be started and monitored even while the thread computation is ongoing.
Due to the Global Interpreter Lock and the fact that we don't release it in any of our SWIG wrappers, only one ThreadedJob will actually be run at a time.
Note that the directory in which the command will be executed can't be
guaranteed for a job run in a separate thread. Even if an explicit
os.chdir
is invoked in the doCommand
implementation, control may switch to the main thread and the directory
could change before the subsequent statement is executed. So, all I/O
must be done on absolute paths.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Override the base Don't override this method in subclasses and don't use
|
Update the current job status.
|
This method is a hook for subclasses. It is called from the update method and operates in the main thread.
Therefore, it can be used to interact with the parent All communication with the compute thread should be done via thread-safe mechanisms such as Queue.Queue. |
This method is a hook for subclasses. It's possible the thread will be finished but the processing of
results is not yet complete. Returning True here will keep the job alive
and the |
Run the command in a separate thread.
|
This method set termination request for threaded job. After 60s, the threaded job is marked as done if it is still alive. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon May 19 23:05:22 2014 | http://epydoc.sourceforge.net |