コード例 #1
0
ファイル: redis_manager.py プロジェクト: pyople/pyople
 def delete(self, server_task, subtask):
     """Delete the data in the database associated with
     the server_task and subtask. Publish the message to finish the task."""
     if subtask:
         name_task = code_new_task(server_task, subtask)
     else:
         name_task = server_task
     self.redis_manager.tasks_pub.send(code_finish(name_task))
     self.redis_manager.db_delete(map(lambda(x): code_output(name_task, x),
                   range(self.num_output)))
コード例 #2
0
 def delete(self, server_task, subtask):
     """Delete the data in the database associated with
     the server_task and subtask. Publish the message to finish the task."""
     if subtask:
         name_task = code_new_task(server_task, subtask)
     else:
         name_task = server_task
     self.redis_manager.tasks_pub.send(code_finish(name_task))
     self.redis_manager.db_delete(
         map(lambda (x): code_output(name_task, x), range(self.num_output)))
コード例 #3
0
ファイル: worker.py プロジェクト: pyople/pyople
 def _new_code(self):
     """Create the code for a new task.
     The new code can't be an existing code."""
     new = code_new_task(self.code, self.total_code)
     self.total_code += 1
     return new
コード例 #4
0
ファイル: worker.py プロジェクト: pyople/pyople
 def _new_code(self):
     """Create the code for a new task.
     The new code can't be an existing code."""
     new = code_new_task(self.code, self.total_code)
     self.total_code += 1
     return new