Uranium
Application Framework
UM.Job.Job Class Reference
Inheritance diagram for UM.Job.Job:
UM.FileHandler.ReadFileJob.ReadFileJob UM.FileHandler.WriteFileJob.WriteFileJob UM.Scene.Platform._LoadPlatformJob UM.Mesh.ReadMeshJob.ReadMeshJob

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

 finished = Signal()
 
 progress = Signal()
 

Detailed Description

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

Member Function Documentation

◆ cancel()

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.

◆ getError()

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.

◆ getResult()

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.

◆ hasError()

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.

◆ isFinished()

def UM.Job.Job.isFinished (   self,
  bool 
)
Check whether the job has finished processing.

◆ isRunning()

def UM.Job.Job.isRunning (   self,
  bool 
)
Check whether the job is currently running.

:return:

◆ run()

def UM.Job.Job.run (   self,
  None 
)
Perform the actual task of this job. Should be reimplemented by subclasses.

:exception NotImplementedError

◆ start()

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()

◆ yieldThread()

def UM.Job.Job.yieldThread (   None)
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.

The documentation for this class was generated from the following file: