Ejemplo n.º 1
0
 def sync_with_children(self):
     """
     与子进程同步数据
     :return:
     """
     for child_id in self.children:
         context = data_service.get_object(self._context_key(child_id))
         parent_data = data_service.get_object(self._data_key(child_id))
         self.top_pipeline.context().update_global_var(context.variables)
         self.top_pipeline.data.update_outputs(parent_data.get_outputs())
     self.clean_children()  # remove all children
Ejemplo n.º 2
0
 def sync_with_children(self):
     """
     与子进程同步数据
     :return:
     """
     for child_id in self.children:
         context = data_service.get_object(self._context_key(child_id))
         parent_data = data_service.get_object(self._data_key(child_id))
         if context is None or parent_data is None:
             raise exceptions.ChildDataSyncError(
                 'sync data with children %s failed, context(%s) or parent_data(%s) is None'
                 % (child_id, context, parent_data))
         self.top_pipeline.context().update_global_var(context.variables)
         self.top_pipeline.data.update_outputs(parent_data.get_outputs())
     self.clean_children()  # remove all children