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)
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']()
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))
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))