Uranium
Application Framework
|
Public Member Functions | |
def | __init__ (self) |
def | run (self) |
def | getMessage (self) |
def | setMessage (self, message) |
def | getResult (self) |
def | setResult |
def | setError |
def | start (self) |
def | cancel (self) |
def | isRunning (self) |
def | isFinished (self) |
def | hasError (self) |
def | getError (self) |
Static Public Member Functions | |
def | yieldThread () |
Static Public Attributes | |
tuple | finished = Signal() |
tuple | progress = Signal() |
Base class for things that should be performed in a thread. The Job class provides a basic interface for a 'job', that is a self-contained task that should be performed in a thread. It makes use of the JobQueue for the actual threading. :sa JobQueue
def UM.Job.Job.cancel | ( | self, | |
None | |||
) |
Cancel the job. This will remove the Job from the JobQueue. If the run() function has already been called, this will do nothing.
def UM.Job.Job.getError | ( | self, | |
Optional, | |||
Exception | |||
) |
Get the error that was encountered during execution. :return: The error encountered during execution or None if there was no error.
def UM.Job.Job.getResult | ( | self, | |
Any | |||
) |
Get the result of the job. The actual result object returned by this method is dependant on the implementation.
def UM.Job.Job.hasError | ( | self, | |
bool | |||
) |
Check whether the Job has encountered an error during execution. :return: True if an error was set, False if not.
def UM.Job.Job.isFinished | ( | self, | |
bool | |||
) |
Check whether the job has finished processing.
def UM.Job.Job.isRunning | ( | self, | |
bool | |||
) |
Check whether the job is currently running. :return:
def UM.Job.Job.run | ( | self, | |
None | |||
) |
Perform the actual task of this job. Should be reimplemented by subclasses. :exception NotImplementedError
def UM.Job.Job.start | ( | self, | |
None | |||
) |
Start the job. This will put the Job into the JobQueue to be processed whenever a thread is available. :sa JobQueue::add()
|
static |
Utility function that allows us to yield thread processing. This is mostly a workaround for broken python threads. This function forces a GIL release and allows a different thread to start processing if it is waiting.