def run(self): """Run Task job. Overriding of the self.run_task() method instead is recommended. This method will create thread which will run the self.run_task() method. """ thread = AnacondaThread(name=self._thread_name, target=self.runnable) if not threadMgr.exists(self._thread_name): threadMgr.add(thread) self.running_changed() threadMgr.call_when_thread_terminates(self._thread_name, self.running_changed) else: raise TaskAlreadyRunningError("Task {} is already running".format( self.name))
def running(self): """Is the payload thread running right now?""" return threadMgr.exists(THREAD_PAYLOAD_RESTART) or threadMgr.exists( THREAD_PAYLOAD)
def is_running(self): """Is the task running.""" return threadMgr.exists(self._thread_name)
def running(self): """Is the payload thread running right now?""" return threadMgr.exists(THREAD_PAYLOAD_RESTART) or threadMgr.exists(THREAD_PAYLOAD)