def run(self):
     utils.spawn_thread(self._poll)
     try:
         while self.run_daemon_loop:
             time.sleep(1)
     finally:
         LOG.info("Killing poller thread")
Example #2
0
 def run(self):
     utils.spawn_thread(self._poll)
     try:
         while self.run_daemon_loop:
             time.sleep(1)
     finally:
         LOG.info("Killing poller thread")
 def _spawn_monitors(self):
     # Stop currently running monitors
     self.monitor_runs['monitor_runs'] = -1
     self.monitor_runs = {'monitor_runs': float('inf')}
     if self.apic_username and self.apic_password:
         utils.spawn_thread(self._thread_monitor, self.session.login_thread,
                            'login_thread', self.monitor_runs)
     utils.spawn_thread(
         self._thread_monitor, self.session.subscription_thread,
         'subscription_thread', self.monitor_runs)
 def _spawn_monitors(self):
     self.login_thread = None
     self.subs_thread = None
     if not self.monitor_thread:
         self.monitor_thread = utils.spawn_thread(self._thread_monitor,
                                                  self.monitor_runs)
     self.login_thread = self.session.login_thread
     self.subs_thread = self.session.subscription_thread
 def _start_observers(self, types_to_observe):
     self._init_aim_k8s(types_to_observe)
     for id, typ in enumerate(list(types_to_observe)):
         self._observe_thread_state[id] = dict(watch_stop=False)
         thd = utils.spawn_thread(
             self._observe_objects, self.klient.watch.stream, typ, id,
             self._version_by_type.get(typ))
         self._observe_thread_state[id]['thread'] = thd
Example #6
0
 def run(self):
     threads = {
         'observer': self.observer_thread,
         'persister': self.persistence_thread
     }
     for attr, thd in threads.iteritems():
         thd = utils.spawn_thread(thd)
         setattr(self, attr, thd)
 def _spawn_monitors(self):
     self.login_thread = None
     self.subs_thread = None
     if not self.monitor_thread:
         self.monitor_thread = utils.spawn_thread(self._thread_monitor,
                                                  self.monitor_runs)
     self.login_thread = self.session.login_thread
     self.subs_thread = self.session.subscription_thread
 def _spawn_listener(self):
     return utils.spawn_thread(self._listener)
 def _spawn_listener(self):
     return utils.spawn_thread(self._listener)
Example #10
0
 def _spawn_heartbeat_loop(self):
     utils.spawn_thread(self._heartbeat_loop)