parameters: (self)
docstring: monitor the tactic threads
docstring_summary: monitor the tactic threads
docstring_tokens: monitor the tactic threads
function: def monitor(self):
          '''monitor the tactic threads'''
          start_time = time.time()
          log_dir = "%s/log" % Environment.get_tmp_dir()
          
          while 1:
              end = False
              try:
                  monitor_stop = os.path.exists('%s/stop.monitor'%log_dir)
                  if monitor_stop:
                      for tactic_thread in self.tactic_threads:
                          tactic_thread.end = True
                      break
                  if self.check_interval:
                      # don't check threads during startup period
                      if not self.startup:
                          time.sleep(self.check_interval)
                          for tactic_thread in self.tactic_threads:
                              tactic_thread._check()
                      else:
                          if time.time() - start_time > self.check_interval:
                              self.startup = False
                          else:
                              time.sleep(1)
  
                  else:
                      # Windows Service does not need this 0 check_interval
                      # any more.  
                      break
  
              except KeyboardInterrupt as e:
                  #print("Keyboard interrupt ... exiting Tactic")
                  for tactic_thread in self.tactic_threads:
                      tactic_thread.end = True
                      end = True
  
              if end:
                  break
  
  
          self.final_kill()
function_tokens: def monitor ( self ) : start_time = time . time ( ) log_dir = "%s/log" % Environment . get_tmp_dir ( ) while 1 : end = False try : monitor_stop = os . path . exists ( '%s/stop.monitor' % log_dir ) if monitor_stop : for tactic_thread in self . tactic_threads : tactic_thread . end = True break if self . check_interval : # don't check threads during startup period if not self . startup : time . sleep ( self . check_interval ) for tactic_thread in self . tactic_threads : tactic_thread . _check ( ) else : if time . time ( ) - start_time > self . check_interval : self . startup = False else : time . sleep ( 1 ) else : # Windows Service does not need this 0 check_interval # any more.   break except KeyboardInterrupt as e : #print("Keyboard interrupt ... exiting Tactic") for tactic_thread in self . tactic_threads : tactic_thread . end = True end = True if end : break self . final_kill ( )