Beispiel #1
0
    def __init__(self, func, interval, max_run_time):
        
        StateController.__init__(self)

        self._func = func
        self._gap = interval
        self._max_run_time = max_run_time

        self._thread = threading.Thread(target=self._loop_thread)
        self._thread.daemon = True

        self._lock = threading.Lock()
        self._loop_active = True
Beispiel #2
0
 def stop(self):
     
     with self._lock:
         self._loop_active = False
     self._thread.join(timeout=20)
     StateController.stop(self)
Beispiel #3
0
 def start(self):
     
     StateController.start(self)
     self._thread.start()