def _restore_task_clean_data_tornado(self, msg): """Create and register a task received during clean mode.""" list_code, code, procedure, needed = msg list_code = json_loads(list_code) needed = json_loads(needed) actual_data = TaskVentilatorData(code, needed, procedure, self) task_needed = set(map(decode_output, needed)) self_needed = code in task_needed if self_needed: task_needed.remove(code) actual_data.set_left(task_needed, self_needed) actual_data.update_data(len(task_needed) - len(list_code)) self._register_needed(list_code, actual_data) [self.tasks_pub.send(code_resend(c)) for c in list_code]
def _restore_task_clean_server_tornado(self, msg): """Create and register a server task received during clean mode.""" list_code, code, address, num_output = msg list_code = json_loads(list_code) num_output = int(num_output) actual_data = TaskServerData(code, address, num_output, self) self._register_needed(list_code, actual_data) self.tasks_pub.send(code_resend(code))
def _create_task_tornado(self, msg): """Auxiliary function of _create_task using tornado sockets.""" code, procedure, needed = msg needed = json_loads(needed) self._create_task(code, procedure, needed)