Пример #1
0
 def _development_dump_data(self, code):
     """Auxiliary function for dumping data."""
     try:
         res = [zmq_dumps(d) for d in self.data]
     except TypeError:
         raise TypeError("Data of task %s with procedure %s not "
                         "serializable" % (code, self.procedure))
     return res
Пример #2
0
 def _development_dump_data(self, code):
     """Auxiliary function for dumping data."""
     try:
         res = [zmq_dumps(d) for d in self.data]
     except TypeError:
         raise TypeError("Data of task %s with procedure %s not "
                         "serializable" % (code, self.procedure))
     return res
Пример #3
0
 def _send_task_worker(self, code):
     """
     Overridden function, the task is added to the ventilator
     global_ready_task attribute.
     """
     if self.worker.display:
         print('Send to worker: ' + str([code, self.procedure, self.data]))
     res = self.worker.global_ready_task.setdefault(code, [self.procedure])
     res.extend(self._development_dump_data(code))
     if not self.has_kwargs:
         res.append(zmq_dumps([]))
Пример #4
0
 def send_worker(self):
     """Overridden function, set the task to the ready tasks."""
     res = self.ventilator.global_ready_task.setdefault(
             self.code, [self.procedure.name])
     data = self.wait_exists()
     res.extend(data)
     if not self._has_kwargs():
         res.append(zmq_dumps([]))
     if self.ventilator.display:
         print('Send: ' + str([self.code, self.procedure.name, data]))
     if self.self_needed:
         self.db_delete_needed()
Пример #5
0
 def send_worker(self):
     """Overridden function, set the task to the ready tasks."""
     res = self.ventilator.global_ready_task.setdefault(
         self.code, [self.procedure.name])
     data = self.wait_exists()
     res.extend(data)
     if not self._has_kwargs():
         res.append(zmq_dumps([]))
     if self.ventilator.display:
         print('Send: ' + str([self.code, self.procedure.name, data]))
     if self.self_needed:
         self.db_delete_needed()
Пример #6
0
 def _send_task_worker(self, code):
     """
     Overridden function, the task is added to the ventilator
     global_ready_task attribute.
     """
     if self.worker.display:
         print('Send to worker: ' +
               str([code, self.procedure, self.data]))
     res = self.worker.global_ready_task.setdefault(
             code, [self.procedure])
     res.extend(self._development_dump_data(code))
     if not self.has_kwargs:
         res.append(zmq_dumps([]))