Exemple #1
0
    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))
Exemple #2
0
 def running(self):
     """Is the payload thread running right now?"""
     return threadMgr.exists(THREAD_PAYLOAD_RESTART) or threadMgr.exists(
         THREAD_PAYLOAD)
Exemple #3
0
 def is_running(self):
     """Is the task running."""
     return threadMgr.exists(self._thread_name)
Exemple #4
0
 def is_running(self):
     """Is the task running."""
     return threadMgr.exists(self._thread_name)
Exemple #5
0
 def running(self):
     """Is the payload thread running right now?"""
     return threadMgr.exists(THREAD_PAYLOAD_RESTART) or threadMgr.exists(THREAD_PAYLOAD)