コード例 #1
0
 def runforever(self):
     while True:
         processes_infos = self._poll_processes()
         for info in processes_infos:
             if self._process_info_cache.update_cache(info):
                 self._event_handlers['PROCESS_STATE'](
                     cpm.convert_to_pi_event(info))
         time.sleep(5)
コード例 #2
0
 def _poll_containers(self):
     containers = self._list_containers(self._unit_names)
     for name in self._unit_names:
         container = containers.get(name)
         info = (cpm.dummy_process_info(name) if container is None else
                 self._container_to_process_info(container))
         if self._process_info_cache.update_cache(info):
             self._event_handlers['PROCESS_STATE'](cpm.convert_to_pi_event(info))
             if self._update_process_list:
                 self._event_handlers['PROCESS_LIST_UPDATE']()
コード例 #3
0
 def _poll_containers(self):
     containers = self._list_containers(self._unit_names)
     for name in self._unit_names:
         container = containers.get(name)
         info = (cpm.dummy_process_info(name) if container is None else
                 self._container_to_process_info(container))
         if self._process_info_cache.update_cache(info):
             self._event_handlers['PROCESS_STATE'](cpm.convert_to_pi_event(info))
             if self._update_process_list:
                 self._event_handlers['PROCESS_LIST_UPDATE']()
コード例 #4
0
 def run_job(self):
     processes_infos = self._poll_processes()
     for info in processes_infos:
         if self._process_info_cache.update_cache(info):
             self._event_handlers['PROCESS_STATE'](cpm.convert_to_pi_event(info))
コード例 #5
0
 def run_job(self):
     processes_infos = self._poll_processes()
     for info in processes_infos:
         if self._process_info_cache.update_cache(info):
             self._event_handlers['PROCESS_STATE'](
                 cpm.convert_to_pi_event(info))